Font size
Worksheetsjs_edu_wrap_up
Total questions: 20
Worksheet time: 13mins
What will this code do?
Throw a ReferenceError
Print "orange"
Print "undefined"
Which value is falsy?
'false'
[]
{}
``
new Boolean(false)
What is the result of this code?
'2' > '12'
TypeError
true
false
NaN
What will this code print?
Jack
Daniel
undefined
ReferenceError
What will this code print?
0
1
2
What is the result of this code?
((...x, y) => x)(1, 2, 3)
[1, 2, 3]
[1, 2]
1
SyntaxError
What is the result of this code?
['a', 'b', 'c'][3]
'c'
undefined
ReferenceError
'a'
What is the result of this code?
['', 0, null].indexOf(false)
0
1
2
-1
What is the result of this code?
[15, 1, 2].sort()
[1, 2, 15]
['1', '2', '15']
[1, 15, 2]
['1', '15', '2']
What is the result of the following code?
[0, 1, 2, 3].some(v => v % 2 === 0)
0
[0, 2]
true
false
What will this code print?
"Oh noes!" and "The fails!"
"Oh noes!"
"That fails"
"actually that worked"
nothing
What will the following code print?
hello
world
world
hello
world
undefined
world
What will this code do?
Prints "hello"
SyntaxError
Nothing
The order in which nested DOM elements receive the same event from the innermost element to the outermost element is called ________
capturing
bubbling
In a click event listener of a link, which function can cancel the browser's navigation to its URL?
preventDefault
stopPropagation
removeEventListener
Which call adds element ele between divs div1 and div2?
div1.appendChild(ele)
div2.parentNode.
appendChild(ele)
div2.parentNode.
insertBefore(ele, div2)
What will this code do?
(Date has a getFullYear method.)
Fails to compile
Prints TypeError
Prints "2022"
Which features do TypeScript add on top of JavaScript? (Select all correct answers.)
classes
enums
generics
optional typing
unions
What will this code print?
"a is 47"
"a is 0"
"a is "
None of the above
What will this code do?
Fails to compile
Warns about implicit cast
Prints "1"
