Web Programming (3160713) MCQs

MCQs of Client Side Scripting using JavaScript

Showing 31 to 40 out of 41 Questions
31.
Math.round(-20.51)=?
(a) 20
(b) -20
(c) -21
(d) 19
Answer:

Option (c)

32.
_________ keyword is used to declare variables in javascript.
(a) Var
(b) Dim
(c) String
(d) Variable
Answer:

Option (a)

33.
In Javascript, What does isNaN function do ?
(a) Return true if the argument is not a number.
(b) Return false if the argument is not a number.
(c) Return true if the argument is a number.
(d) None of the above
Answer:

Option (a)

34.
Which of the following properties hold the values of the pixels of the length of the width and height of the viewer's screen resolution?
(a) screen.width and screen.height
(b) Resolution.width and Resolution.height
(c) screen.pixels.width and screen.pixels.height
(d) ViewerScreen.width and ViewerScreen.height
Answer:

Option (a)

35.
In JavaScript, Window.alert() is used to allow user to enter something
(a) True
(b) False
Answer:

Option (b)

36.
How to speicfy the color of the hypertext links with JavaScript ?
(a) document.linkColor="#00FF00";
(b) document.LColor="#00FF00";
(c) document.LinkC="#00FF00";
(d) document.hyperTextLink="#00FF00";
Answer:

Option (a)

37.
How do substring() and substr() differ?
(a) One is not a method of the String object.
(b) substr() takes three arguments, substring() only two.
(c) Only one accepts a desired string length as an argument.
(d) Besides the spelling, nothing.
Answer:

Option (c)

38.
Which of these is not a method of the Math object?
(a) atan()
(b) atan2()
(c) eval()
(d) acos()
Answer:

Option (c)

39.

What will be the output for the given code spinnet 

var d1 = new Date(2021,7,1);
console.log(d1.getYear());
(a)

2021

(b)

2121

(c)

121

(d)

21

Answer:

Option (c)

40.

Regular Expression to validate enrollment number of only computer engineering students from darshan institute.

(a)

^18054[0-9]{7}$

(b)

^[0-9]{2}054[0-9]{7}$

(c)

^18054[0-9]{2}07[0-9]{3}$

(d)

^[0-9]{2}054[0-9]{2}07[0-9]{3}$

Answer:

Option (d)

Showing 31 to 40 out of 41 Questions