Basic And Variables - Study Mode
[#6] What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?
Correct Answer
(C) That property will not be enumerated
Explanation
Solution: If the body of a for/in loop deletes a property that has not yet been enumerated, that property will not be enumerated. If the body of the loop defines new properties on the object, those properties will generally not be enumerated.
[#7] What will be the step of the interpreter in a jump statement when an exception is thrown?
Correct Answer
(C) The interpreter jumps to the nearest enclosing exception handler
Explanation
Solution: When an exception is thrown in a jump statement, the interpreter jumps to the nearest enclosing exception handler, which may be in the same function or up the call stack in an invoking function.
[#8] Among the keywords below, which one is not a statement?
Correct Answer
(D) use strict
Explanation
Solution: use strict is a directive introduced in ECMAScript5. Directives are not statements because it does not include any language keywords. Also, it can appear only at the start of a script or at the start of a function body, before any real statemenst have appeared.
[#9] The unordered collection of properties, each of which has a name and a value is called
Correct Answer
(B) Object
Explanation
Solution: An object is an unordered collection of properties, each of which has a name and a value. Property names are strings, so we can say that objects map strings to values.
[#10] A function definition expression can be called
Correct Answer
(B) Function literal
Explanation
Solution: A function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function followed by a comma-separated list of zero or more identifiers (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces.