Search Header Logo

JS Concepts Quiz

Authored by Sean Idisi

Computers

Professional Development

Used 1+ times

JS Concepts Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

24 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to declare a variable in JavaScript?

`var myVariable;`

`variable myVariable;`

`v myVariable;`

`myVariable var;`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What data type is `true` in JavaScript?

String

Number

Boolean

Object

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid way to define a function in JavaScript?

`function myFunction() {}`

`def myFunction() {}`

`func myFunction() {}`

`function: myFunction() {}`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```javascript let x = 5; { let x = 10; } console.log(x); ```

5

10

undefined

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to write an if statement in JavaScript?

`if x = 5 {}`

`if (x == 5) {}`

`if x == 5 {}`

`if (x = 5) {}`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```javascript let x = 10; if (x > 5) { x = x + 5; } else { x = x - 5; } console.log(x); ```

5

10

15

20

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop will execute at least once regardless of the condition?

`for` loop

`while` loop

`do...while` loop

`foreach` loop

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?