From 01b0e12ba27b5069248fd09235e9a7143915ee30 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:02:49 +0800 Subject: remove `notranslate` class in zh-CN --- .../web/javascript/reference/errors/not_defined/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/errors/not_defined') diff --git a/files/zh-cn/web/javascript/reference/errors/not_defined/index.html b/files/zh-cn/web/javascript/reference/errors/not_defined/index.html index a092f394ec..cc5fadb2a8 100644 --- a/files/zh-cn/web/javascript/reference/errors/not_defined/index.html +++ b/files/zh-cn/web/javascript/reference/errors/not_defined/index.html @@ -7,7 +7,7 @@ translation_of: Web/JavaScript/Reference/Errors/Not_defined

错误信息

-
ReferenceError: "x" is not defined
+
ReferenceError: "x" is not defined
 

错误类型

@@ -26,19 +26,19 @@ translation_of: Web/JavaScript/Reference/Errors/Not_defined

变量没有被声明

-
foo.substring(1); // ReferenceError: foo is not defined
+
foo.substring(1); // ReferenceError: foo is not defined
 

“foo” 变量没有在任何地方被声明。它需要是某种字符串,这样 {{jsxref("String.prototype.substring()")}} 方法才可以正常工作。

-
var foo = 'bar';
+
var foo = 'bar';
 foo.substring(1); // "ar"

错误的作用域

变量必须是在它当前的执行环境中可用的。在一个函数(function)中定义的变量不能从这个函数外部的任何地方访问,因为这个变量的作用域仅在这个函数的内部。

-
function numbers () {
+
function numbers () {
   var num1 = 2,
       num2 = 3;
   return num1 + num2;
@@ -48,7 +48,7 @@ console.log(num1); // ReferenceError num1 is not defined.

然而,一个函数可用使用在它所被定义的作用域中的所有变量。换句话说,当一个函数被定义在全局作用域的时候,它可以访问所有在全局作用域中定义的变量。

-
var num1 = 2,
+
var num1 = 2,
     num2 = 3;
 
 function numbers () {
-- 
cgit v1.2.3-54-g00ecf