From 56e93efc665e4c3062474b43a010d4c57ccb5859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E5=86=9B?= <724099654@qq.com> Date: Mon, 20 May 2019 12:54:54 +0800 Subject: [PATCH] add TDZ example --- js/TDZ.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 js/TDZ.js diff --git a/js/TDZ.js b/js/TDZ.js new file mode 100644 index 0000000..8a6101b --- /dev/null +++ b/js/TDZ.js @@ -0,0 +1,6 @@ +let value1 = 'outer value' + +(function() { + console.log(value1) // ReferenceError + let value1 = 'inner value' // defined value1 +}()) \ No newline at end of file -- Gitee