wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

JavaScript_G9_Quiz

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

It's a complex programming language that creates dynamic programming.

a)

HTML

b)

Python

c)

JavaScript

d)

CSS

2.

Which of the following is a data type in JavaScript that represents a value that cannot be altered?

a)

Mutable

b)

Reference

c)

Primitive

d)

Composite

3.

Which keyword is used in JavaScript to declare a variable that cannot be reassigned?

a)

const

b)

let

c)

var

d)

final

4.

const greeting= "good morning";

What could be the mistakes in the code if it shows error in the result?

(a)  

5.

keywords such as if, switch, and for, spaces are usually added before and after the__________?

Ex. if 10<8

a)

Indention

b)

Whietspace

c)

semi colon

d)

Parentheses

6.

A fundamental data type that can hold one of two possible values: true or false.

(a)  

7.

During a group project, Charlotte noticed that one of the team members was not contributing anything to the discussion. When asked about their input, they simply stated that they had nothing to add. What does this indicate about their involvement?

a)
Null
b)

Undefined

c)

Error

d)

None

8.

Which of the following are considered Primitive data types?

a)

Number, boolean, and null

b)

String, array, and object

c)

Boolean, undefined, and symbol

d)

String, number, and null

9.

var strvar =’Please,please,please’ + by Sabrina Carpenter;

console.log(strVar);


Write the correct script to make the result show "Please,please,please by Sabrina Carpenter

(a)  

10.

var flag=true;

//flag=false;

console.log(flag);

Write the correct script to make the result show "true"

(a)  

11.

It's a type of JavaScript language that you don’t have to declare a variable’s type, because JavaScript automatically determines it for you.

a)
Dynamic Typing
b)

Loose type

c)

Non primative

d)

Boolean

12.

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

a)

String

b)

Number

c)

Array

d)

Boolean

13.

During a coding class, Benjamin asked his peers, "What keyword is used to define a constant variable in JavaScript?"

a)

let

b)

const

c)

var

d)

static

14.

A programming script that Initially had another name: “LiveScript

a)

HTML

b)

Python

c)

JavaScript

d)

CSS

15.

Why it is important to know your content type for making your own youtube channel?

a)

To know your target audience and strategy for your content.

b)

To know what content to put in Youtube Channel.

c)

To gain the interest of the Audience.

d)

To know your strategies how to gain more viewers.

16.

Var is used to declare and assign variables in JavaScript.

Choose the best example for Var.

a)

let x = 5; var y = 10; const z = 10;

b)

var x = '5'; let y = '10'; const z = '15';

c)

int a = 5; float b = 10; double c = 15;

d)

var x = 5; let y = 10; const z = 15;

17.
a)

console.log

b)

alert()

c)

console.log=()

d)

var =

18.

Write the correct script.

Object : {"student":"Ariana","school":"DevDelight.com"}

a)

var classroom = ()

// var classroom = new object();

classroom.student ='Ariana';

classroom.school ='DevDelight.com';

console.log('Object:' + JSON.stringify(classroom))

b)

  • var classroom = {} // var classroom = new object(); classroom.student ='Ariana'; classroom.school ='DevDelight.com'; console.log('Object:' + JSON.stringify(classroom));

  • "Object:{\"student\":\"Ariana\",\"school\":\"DevDelight.com\"}"

c)

  • var classroom = {} // var classroom = new object(); classroom.student ='Ariana'; classroom.school ='DevDelight.com'; console.log('Object:' + JSON.stringify(classroom));

  • "Object:{\"student\":\"Ariana\",\"school\":\"DevDelight.com\"}"

d)

var classroom = {}

// var classroom = new object();

classroom.student ='Ariana';

classroom.school ='DevDelight.com';

console.log('Object:' + JSON.stringify(classroom))

19.

Difference between var and Let

a)
'let' can be redeclared in the same scope like 'var'.
b)
Both 'var' and 'let' are block-scoped.
c)
'var' is always preferred over 'let' for better performance.
d)
The main difference is that 'var' is function-scoped or globally-scoped, while 'let' is block-scoped.
20.

What will be the output of the following code: console.log(typeof NaN);

a)

Number

b)

String

c)

Undefined

d)

Object