| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Errors/Not_defined | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
ReferenceError: "x" is not defined
. . , scope .
:
( jQuery ) , "$" . <script> .
foo.substring(1); // ReferenceError: foo is not defined
"foo" . String.prototype.substring() .
var foo = "bar";
foo.substring(1); // "ar"
. . , .
function numbers() {
var num1 = 2,
num2 = 3;
return num1 + num2;
}
console.log(num1); // ReferenceError: num1 is not defined
, . , .
var num1 = 2,
num2 = 3;
function numbers() {
return num1 + num2;
}
console.log(num1); // 2
This page was last modified on 2024 12 17 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |