How do you create a function in JS?
Anonymous Quiz
80%
function myFunc() {}
7%
func myFunc()
7%
def myFunc()
7%
function: myFunc()
How do you write an alert in JS?
Anonymous Quiz
80%
alert(Hi!)
7%
msg(Hi!)
9%
console.log(Hi!)
4%
prompt(Hi!)
Which keyword declares a variable that can be reassigned?
Anonymous Quiz
7%
var
10%
const
7%
let
76%
Both let and var
What is the output of console.log( typeof 42)?
Anonymous Quiz
86%
number
5%
string
5%
boolean
5%
object
How do you access the first element of arr?
Anonymous Quiz
85%
arr[0]
5%
arr[1]
5%
arr.first
5%
arr[0,0]
Which keyword defines a variable globally (if not in a function)?
Anonymous Quiz
28%
var
7%
let
9%
const
56%
Both A and B
Which event occurs when a user clicks on an HTML element?
Anonymous Quiz
86%
onclick
5%
onmouseover
7%
onkeypress
2%
onhover
How do you find the length of a string str?
Anonymous Quiz
0%
str.size
55%
str.length
14%
str.len
32%
str.length()
Which function pops the last element from an array?
Anonymous Quiz
71%
arr.pop()
20%
arr.push()
2%
arr.shift()
7%
arr.unshift()
What does document.write(Hello) do?
Anonymous Quiz
72%
Writes on HTML page
17%
Writes in console
9%
Shows an alert
2%
Throws an error
🤔5
Which keyword declares a block-scoped variable?
Anonymous Quiz
9%
var
16%
let
4%
const
71%
Both let and const
Which method adds an element to the end of an array?
Anonymous Quiz
56%
push()
35%
pop()
5%
shift()
5%
unshift()
Which method removes the first element from an array?
Anonymous Quiz
9%
push()
26%
pop()
53%
shift()
12%
unshift()
Which event occurs when the user hovers over an element?
Anonymous Quiz
28%
onhover
51%
onmouseover
7%
mousehover
14%
hover
👍1
Which method joins array elements into a string?
Anonymous Quiz
74%
join()
12%
split()
12%
concat()
2%
merge()
How do you remove duplicates from an array?
Anonymous Quiz
51%
arr.filter()
21%
arr.remove()
21%
arr.delete()
7%
arr.uniq()