Here, JavaScript is running in strict mode, hence when you reassign the value for the name property, JavaScript will throw an exception as shown below.
There are some differences between declared and undeclared variables, which might lead to unexpected results and that's why JavaScript presents an error in strict mode.
Both String(1e2) and String(100) happen to be equal to"100", which causes the“Duplicate data property in object literal not allowed in strict mode” error.
JavaScript严格模式不允许默认绑定。
JavaScript strict mode does not allow default binding.
在严格模式中,则是undefined。
In strict mode, this is undefined.
但是,严格模式会引发错误。
However, strict mode will throw an error.
什么东西在严格模式下被禁止??
What things are prohibited in strict mode?
严格模式不允许未声明的变量。
Strict mode doesn't allow you to use undeclared variables.
在严格模式中,这会抛出SyntaxError:.
In strict mode code, however, this will throw a SyntaxError.
严格模式下,this不会指向window.
In non-strict mode, this refers to the window object.
它在严格模式和非严格模式之间也有一些区别。
It also has some differences between strict mode and non-strict mode..
仅在严格模式下出现的ReferenceError警告。
ReferenceError warning in strict mode only.
这种方式在严格模式和非严格模式下都行得通。
It works the same way in both strict and non-strict mode.
在函数中,严格模式下,this是undefined。
When in strict mode, this in functions is undefined.
English
Bahasa indonesia
日本語
عربى
Български
বাংলা
Český
Dansk
Deutsch
Ελληνικά
Español
Suomi
Français
עִברִית
हिंदी
Hrvatski
Magyar
Italiano
Қазақ
한국어
മലയാളം
मराठी
Bahasa malay
Nederlands
Norsk
Polski
Português
Română
Русский
Slovenský
Slovenski
Српски
Svenska
தமிழ்
తెలుగు
ไทย
Tagalog
Turkce
Українська
اردو
Tiếng việt