top of page

Java Script MCQ Questions

Updated: Apr 6

Q1. JavaScript was invented by

  1. W3- Group

  2. Hel Sinki Linux

  3. Brendan Eich

  4. None

Ans: C

Q2. Variable can hold which type of value at a time:-

A.    Multiple

B.     Single

C.     Double

D.    None

Ans: B

Q3. Javascript is a Language -

  1. Programming

  2. Scripting

  3. Hyper Text Markup

  4. None

Ans: B

Q4. The extension of Javascript fill is -

  1. .HTML

  2. .AJS

  3. .JS

  4. HTM

Ans: C

Q5. JS is Ideal to

  1. Make Competition in HTML simpler

  2. the Download time for client

  3. Minimize Storage requirement on the Web Server

  4. None

Ans: C

Q6. Integer variable is declared in JS.

A.    Int num:

B.     Integer num;

C.     Integers nums;

D.    Var num;

Ans: D

Q7. Multiple declaration of variable are separated by

A.    ,

B.     :

C.     *

D.    ;

Ans: A

Q8. Java Script was originally developed under the name

A.    Action Script

B.     Senche()

C.     Cak

D.    Mocha

Ans: D

Q9. Which was the first browser to support JS?

A.    NetScape

B.     IE

C.     Google Chrome

D.    Mozilla Firefox

Ans: A

Q10. Which of the following attributes is used to include external JS code inside html document?

A.    Script

B.     Src

C.     Link

D.    Rel


Q11. JS is designed for following purpose:

A.    To execute query related to database on server

B.     To style html page

C.     To add inter activity to html page

D.    To perform server site scripting language

Ans: C


Q12. What is output of the following code?

<script language=”javascript”>function n()

{ document.write(2+5+”8”);



A.    258

B.     78

C.     15

D.    None

Ans: B

Q13. What is the output of following code?







A.    44

B.     8

C.     0

D.    None


Q14. Which process is used by checkbox?

A.    Select

B.     Focus

C.     Blur

D.    Click

Ans: D

Q15. Which method of JS that a value of input user and store in a variable?

A.    Alert()

B.     Write()

C.     Prompt()

D.    None

Ans: C

Q16. Which type of JS language is….

A.    Object oriented

B.     Assembly language

C.     High Level Language

D.    Object based

Ans: D

Q17. What is the output of following code?


Var obj={x:10}





A.    1

B.     Error

C.     10

D.    5

Ans: A

Q18. Which of the following also known as conditional expression:

A.    Alternative to if else

B.     Switch statement

C.     If then else statement

D.    Immediate if

Ans: D

Q19. In JS what is a block of statement;

A.    Conditional block

B.     Block that combine a number of statement into a single component

C.     Both A & B

D.    Block that content a single statement

Ans: C

Q20. The function and var are known as

A.    Data types

B.     Keywords

C.     Prototype

D.    Declaration statement

Ans: D

Q21. What is the output of following JS code?

Var count=0;






A.    Error in display

B.     An exception is throwing

C.     The value of count variable is loged or store in a particular location on storage

D.    The value of count from ‘0 to 9’ is display in the console.

Ans: C

Q22. The output of following JS code


Int x=8;








A.    9

B.     0

C.     8

D.    Undefined

Ans: C

Q23. Write the output of following JS Code?

Var grade=”c”;

Var result



Case ‘A’:




Case B:




Case C:






Result =’0’;



A.    10

B.     9

C.     8

D.    0

Ans: C

Q24. What is the output of JS code:

Var x=3;

Var y=2;

Var z =0;



Else if (y==x)




A.    3

B.     Error

C.     1

D.    0


Q25. Which variable takes precedence over the other if the names are same?

A.    The local element

B.     Global variable

C.     Two of Above

D.    None

Ans: A

Q26. Which of the following are the correct ways for calling the JS code:

A.    Preprocessor

B.     RMJ

C.     Triggering ever

D.    Function/method

Ans: D

Q27. Which of the variable is volatile?

A.    Mutable variable

B.     Volatile variable

C.     Immutable volatile

D.    None

Ans: A

Q28. In java script which is not considered as an error?

A.    Syntax error

B.     Missing of semi colons

C.     Division by

D.    Missing of bracket

Ans: C





Q29. Which of the following number object function return the value of number?

A.    Two string ()

B.     Value of function

C.     To local string ()

D.    To precession


Q30. In javascript x==y statement provide that

A.    Both are x and y are equal in value only

B.     Both x and y are are equal in value; type and reference

C.     Both are equal in value and data type

D.    Both are not same at old

Ans: C

Q31. What is the output of following java script code?

Var string1=”40”;

Var value unit =50;

Alert(srrint1+int value)

A.    4090

B.     90

C.     4050

D.    5090

Ans: C

Q32IN JS what will be used for calling function definition expression?

A.    Function prototype

B.     Function literal

C.     Function calling

D.    Function decoration

Ans: B

Q33. Which statement suitable to check if the patterns match with the string?

A.    Text(text)

B.     Equals(pattern)

C.     Text(pattern)

D.    Text==pattern

Ans: D


51 views0 comments


bottom of page