You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -529,7 +529,7 @@ getPersonInfo`${person} is ${age} years old`
529
529
530
530
#### 答案: B
531
531
532
-
If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions!
532
+
如果使用标记模板字面量,第一个参数的值总是字符串值的数组。其余的参数获取的是传递的表达式的值!
533
533
534
534
</p>
535
535
</details>
@@ -561,11 +561,11 @@ checkAge({ age: 18 })
561
561
562
562
#### 答案: C
563
563
564
-
When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same ___location in memory.
The two objects that we are comparing don't have that: the object we passed as a parameter refers to a different ___location in memory than the object we used in order to check equality.
With`"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age`would have gotten added to the global object.
0 commit comments