From 5f34544d858542c28320b2c64cb72c237355ae39 Mon Sep 17 00:00:00 2001 From: Shun Bai Date: Mon, 21 Apr 2014 11:54:55 +0800 Subject: [PATCH] =?UTF-8?q?typeof=20=E7=A4=BA=E4=BE=8B=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E4=B8=AD=E6=AD=A3=E8=AF=AF=E5=AF=B9=E6=AF=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 虽然为了演示 typeof 的作用而省略了 if 块内的语句,但此处的正、误两个示例,其意图正好相反,不知会否给某些读者造成误会。此处修改假设代码的意图为“如果v已定义”。 --- grammar/basic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grammar/basic.md b/grammar/basic.md index 22f4b611..d0d9aa63 100644 --- a/grammar/basic.md +++ b/grammar/basic.md @@ -710,7 +710,7 @@ if (v){ // ReferenceError: v is not defined // 正确的写法 -if (typeof v === "undefined"){ +if (typeof v !== "undefined"){ // ... }