May 1

Weekly JavaScript Quiz Questions & Answers

Here are our last 7 JavaScript quiz questions and their answers.

Answers marked green are the correct ones…


How can you calculate the square root of 16?

How can you calculate the square root of 16?

1. Math.sqrRoot(16);
2. Math.square(16);
3. Math.root(16);
4. Math.sqrt(16);

Which statement skips over the current iteration of a loop?

Which statement skips over the current iteration of a loop?

1. break;
2. continue;
3. skip;
4. switch;

Which method rounds a number up to the closest integer?

Which method rounds a number up to the closest integer?

1. Math.round()
2. Number.ceil()
3. Math.roundUp()
4. Math.ceil()

Assuming const a = [1, 3, -8]; how can you find the smallest number in the array?

Assuming const a = [1, 3, -8]; how can you find the smallest number in the array?

1. a.min()
2. Math.min(a)
3. Math.min(…a)
4. Number.min(…a)

What'd be the output of: !!0;

What’d be the output of: !!0;

1. true
2. false
3. 0
4. NaN

Which method removes the first element from an array?

Which method removes the first element from an array?

1. pop()
2. push()
3. shift()
4. unshift()

What'd be the output of this: 'code'.padEnd(3);

What’d be the output of this: ‘code’.padEnd(3);

1. ‘c’
2. ‘c333’
3. ‘code   ‘
4. ‘code’

Keep a lookout for next week’s quizzes…

And click below to learn the 10 core concepts of JavaScript easily:

BeginnerJS: Learn & Understand The Fundamentals Of JavaScript