wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Summative Test Q3 M1-6

Total questions: 49

Worksheet time: 39mins

Name
Class
Date
1.

Using this after an HTML document is loaded will delete all existing HTML.

a)

InnerHTML

b)

document.write();

c)

window.alert();

d)

console.log();

2.

It defines the HTML content.

a)

InnerHTML

b)

document.write();

c)

window.alert();

d)

console.log();

3.

The _____ assignment operator can also be used to add (concatenate) strings.

a)

+=

b)

-=

c)

*=

d)

/=

4.

It is used to print any kind of variables defined before in it or to just print any message that needs to be displayed to the user.

a)

InnerHTML

b)

document.write();

c)

window.alert();

d)

console.log();

5.

True or False:

It was 1996 when JavaScript was invented

a)

True

b)

False

6.

True or False:

JavaScript is the default language in HTML

a)

True

b)

False

7.

It is appropriate to use (a)   for testing purposes.

Choose from the below words
document.write();
InnerHTML
window.alert();
console.log();
8.

To make the script more readable, it is recommended to apply ___________.

a)

Break

b)

Black label

c)

Line

d)

White space

9.

In programming language, program instructions are called ________.

a)

Literals

b)

Function

c)

String

d)

Statements

10.

________________ is a combination of values, variables, and operators, which computes to a value.

a)

expressions

b)

Syntax

c)

keywords

d)

variables

11.

What kind of special character or symbol separates JS Statements?

a)

Angle Bracket

b)

Asterisk

c)

Bracket

d)

Semicolon

12.

These texts are written within double or single quote. What do you call this one?

a)

Code

b)

Numbers

c)

Strings

d)

Values

13.

There are two types of JavaScript values, Fixed and Variable values.

Fixed values are called _________. Variable values are called Variables

a)

Literals

b)

Constant

c)

Numbers

d)

Strings

14.

What type of redeclaring or assigning variables is this?

var x = 2; // Allowed

var x = 3; // Allowed

x = 4; // Allowed

a)

Redeclaring a JavaScript var variable is allowed anywhere in a program

b)

Redeclaring or reassigning an existing const variable, in the same scope, or in the same block, is not allowed

c)

Redeclaring or reassigning an existing var or let variable to const, in the same scope, or in the same block, is not allowed

d)

Redeclaring a variable with const, in another scope, or in another block, is allowed

15.

It can use the document.getElementById(id) method to access an HTML element, and the id attribute defines the HTML element.

a)

InnerHTML

b)

document.write();

c)

window.alert();

d)

console.log();

16.

True or False:

One of the uses of JavaScript is to link websites

a)

True

b)

False

17.

These are set of rules use in making a webpage.

a)

expression

b)

Syntax

c)

keywords

d)

variables

18.

Creating a variable in JavaScript is called "__________" a variable.

a)

value

b)

declaring

c)

literals

d)

strings

19.

In the JavaScript statement below, which part will Not Allowed

var x = 2; // ---A

const x = 2; // ---B

{ let x = 2; // ---C

const x = 2; // ---D

a)

A and B

b)

B and C

c)

C and D

d)

B and D

20.

_______ keyword is used to declare variables.

a)

VAR

b)

Var

c)

var

d)

VaR

21.

What type of Camel Case is this?

GoodVIBES

a)

Underscore

b)

Lower Camel Case

c)

Upper Camel Case

d)

Mixed Camel Case

22.

________ keyword used to define variable with restricted scope.

a)

var

b)

let

c)

cons

d)

fix

23.

It is a keyword use to declare constant.

a)

var

b)

const

c)

let

d)

x, y, z

24.

What type of Camel Case is this?

hAPPYTOGETHER

a)

Underscore

b)

Lower Camel Case

c)

Upper Camel Case

d)

Mixed Camel Case

25.

It is used to identify actions to be performed. It tells the browser to create variables.

a)

expression

b)

Syntax

c)

keywords

d)

variables

26.

___________________ are ignored and will not be executed by the web browsers.

a)

Expressions

b)

Syntax

c)

Variables

d)

JavaScript Comments

27.

Which of the following stores data values?

a)

expression

b)

Syntax

c)

keywords

d)

variables

28.

What type of operator is used in this example:

var a = 5;

var b = 2;

var c = a * b;

a)

Addition

b)

Subtraction

c)

Multiplication

d)

Division

29.

____________ is used to assign values to variables.

a)

bracket

b)

plus sign

c)

equal sign

d)

semicolon

30.

Match the following

a)

/*_____*/

1.

Multi-line comments

b)

var x, y, z

2.

variables

c)

{ }

3.

block scope

31.

It is a variable inside the function or block scope?

a)

Local scope

b)

Global scope

c)

Function scope

d)

Block scope

32.

It declares variables inside a function and can be accessed only inside the function where they are declared

a)

Local scope

b)

Global scope

c)

Function scope

d)

Block scope

33.

What type of scope is this?

{ var x = 10 ;

var x = 5 ;

var x = 8 ;}

a)

Local-block scope

b)

Global scope

c)

Local-function scope

d)

variable scope

34.

It behaves like a let keyword

a)

const

b)

if

c)

var

d)

try

35.

A declared variable without a value is called ____________.

a)

fixed

b)

undefined

c)

literals

d)

blank

36.

What type of redeclaring or assigning variables is this?

var x = 2; // Allowed

const x = 2; // Not allowed

{ let x = 2; // Allowed

const x = 2; // Not allowed }

a)

Redeclaring a JavaScript var variable is allowed anywhere in a program

b)

Redeclaring or reassigning an existing const variable, in the same scope, or in the same block, is not allowed

c)

Redeclaring or reassigning an existing var or let variable to const, in the same scope, or in the same block, is not allowed

d)

Redeclaring a variable with const, in another scope, or in another block, is allowed

37.

What type of operator is used in this example:

var a = 5

var b = 10

var c = a + b

a)

Addition

b)

Subtraction

c)

Multiplication

d)

Division

38.

What type of Camel Case is this?

Sir_NAVARRO

a)

Underscore

b)

Lower Camel Case

c)

Upper Camel Case

d)

Mixed Camel Case

39.

The __________ keyword is use it cannot be reassigned.

a)

const

b)

if

c)

var

d)

try

40.

Redeclaring or reassigning an existing var or let variable to const, in the same scope, or in the same block, is __________.

a)

Allowed

b)

Not Allowed

c)

Define

d)

Initialized

41.

Redeclaring a variable with const, in another scope, or in another block, is ______________.

a)

Allowed

b)

Not Allowed

c)

Define

d)

Initialized

42.

These are symbols that are used to perform operations on operands.

a)

JavaScript Const

b)

JavaScript Let

c)

JavaScript Arithmetic

d)

JavaScript Operator

43.

Solve the problem:

var x = (75 – 50)*2

x=____

a)

25

b)

50

c)

-25

d)

-50

44.

What type of redeclaring or assigning variables is this?

const x = 2; // Allowed

{ const x = 3; // Allowed }

{ const x = 4; // Allowed }

a)

Redeclaring a JavaScript var variable is allowed anywhere in a program

b)

Redeclaring or reassigning an existing const variable, in the same scope, or in the same block, is not allowed

c)

Redeclaring or reassigning an existing var or let variable to const, in the same scope, or in the same block, is not allowed

d)

Redeclaring a variable with const, in another scope, or in another block, is allowed

45.

It is a symbol for assignment operator.

a)

+

b)

-

c)

/

d)

=

46.

If you add a number and a string, the result will be __________________.

a)

Boolean

b)

Number

c)

String

d)

Zero

47.

These are used to perform arithmetic on numbers

a)

Arithmetic operators

b)

Operators

c)

Assignment operators

d)

Logical operators

48.

When used on strings, the _______________ is called the concatenation operator

a)

= operator

b)

+ operator

c)

* operator

d)

None of the above

49.

Which of the following JavaScript operators is the Modulus (Remainder)?

a)

++

b)

+-

c)

/

d)

%