Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

java script

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of the following is not JavaScript Data Types?

a)

Undefined

b)

Number

c)

Boolean

d)

Float

2.

Which of the following is correct about features of JavaScript?

a)

It can not Handling dates and time.

b)

JavaScript is a object-based scripting language.

c)

JavaScript is not interpreter based scripting language.

d)

All of the above

3.

Which of the following is the correct syntax to display "WadJava" in an alert box using JavaScript?

a)

alert-box("WadJava");

b)

confirm("WadJava");

c)

msgbox("WadJava");

d)

alert("WadJava");

4.

Choose the correct JavaScript syntax to change the content of the following HTML code.

a)

document.getElement (“WadJava").innerHTML = "I am a WadJava";

b)

document.getElementById (“WadJava").innerHTML = "I am a WadJava";

c)

document.getId (“WadJava") = "I am a WadJava";

d)

document.getElementById (“WadJava").innerHTML = I am a WadJava;

5.

What will be the output of the following Javascript code?

var string1 = "WadJava";

var intvalue = 30;

alert( string1 + intvalue );

a)

WadJava 30

b)

30

c)

WadJava30

d)

Exception

6.

Which symbol is used for comments in Javascript?

a)

\\

b)

//

c)

\* *\

d)

\* */

7.

Javascript string using double quotes is exactly the same as a string using single quotes?

a)

True

b)

False

8.

Find output of below code

var a = '20';

var b = a = 30;

document.write(a+b);

a)

Error in Script

b)

'20'30

c)

2030

d)

50

9.

What is divide by 0 in Javascript? var a = 10;

var b = 0;

document.write(a/b);

a)

Nothing is printed

b)

0 is printed

c)

Infinity is printed

d)

Some Garbage Value

10.

In JavaScript, Arrays are data type. State True or False

a)

True

b)

False