Search Header Logo

JAVASCRIPT FINAL EXAM

Authored by UKIZURU MUSTAPHA

others

JAVASCRIPT FINAL EXAM
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a primitive data type in JavaScript?

a) Number

b) String

c) Boolean

d) Object

2.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

What is the output of the following code: let x = [1, 2, 3]; document.write(x[3]);

a) 3
b) undefined
c) Error
d) NaN

3.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

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

a) function myFunction() {}
b) let myFunction = function() {}
c) function = {}

4.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

What is the output of the following code: let x = 10; function foo(){ console.log(x); } foo();

a) 10
b) 5
c) Undefined
d) Error

5.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

What is the output of the following code: let x = 2; x+=1; document.write(x);

a) 4
b) 2
c) 3
d) error

6.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

What is the correct way to declare a variable in JavaScript?

a) let x = 5;
b) variable x = 5;
c)LET x = 5;

7.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

What is the output of the following code: let x = [1, 2, 3]; console.log(x.length);

a) 1
b) 2
c) 3
d) 4

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?