| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Function | [Back] [Original] |
Get to know MDN better
Function() Function eval() () eval() Function
Function.prototype Function
Function.prototype.arguments Function.prototype.caller arguments TypeError
Function.prototype.constructor Function Function
Function
Function.prototype.apply()Function.prototype.bind() this
Function.prototype.call() this
Function.prototype.toString()Function.prototype[Symbol.hasInstance]()Function Function eval()
// `var`
var x = 10;
function createFunction1() {
const x = 20;
return new Function("return x;"); // `x` `x`
}
function createFunction2() {
const x = 20;
function f() {
return x; // `x` `x`
}
return f;
}
const f1 = createFunction1();
console.log(f1()); // 10
const f2 = createFunction2();
console.log(f2()); // 20
Node.js f1() ReferenceError x Node x
| ECMAScript 2027 LanguageSpecification # sec-function-objects |
| Web Proxy Viewer | New URL | Original Page |