| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Errors/Not_defined | [Back] [Original] |
Get to know MDN better
JavaScript " is not defined"
ReferenceError: "x" is not defined (V8 & Firefox) ReferenceError: Can't find variable: x (Safari)
ReferenceError
:
(jQuery ) "$" <script>
foo.substring(1); // ReferenceError: foo is not defined
"foo" String.prototype.substring()
const foo = "bar";
foo.substring(1); // "ar"
function numbers() {
const num1 = 2;
const num2 = 3;
return num1 + num2;
}
console.log(num1); // ReferenceError num1 is not defined.
/p>
const num1 = 2;
const num2 = 3;
function numbers() {
return num1 + num2;
}
console.log(numbers()); // 5
| Web Proxy Viewer | New URL | Original Page |