MCQ : Javscript and angular js For NIELIT O Level Exam

Javscript and angular js For NIELIT O Level Exam

00:00:00

When does the function name become optional in JavaScript?

Option A. When the function is defined as a looping statement
Option B. When the function is defined as expressions
Option C. When the function is predefined
Option D. All of the above
True Answer B

Explanation :
The function name is optional for functions defined as expressions. A function declaration statement actually declares a variable and assigns a function object to it.

When does the function name become optional in JavaScript?

Question No# : 01 out of 20

The snippet that has to be used to check if “a” is not equal to “null” is

Option A. if(a!=null)
Option B. if (!a)
Option C. if(a!null)
Option D. if(a!==null)
True Answer D

Explanation :
The not-equal operator !== compares o to null and evaluates to either true or false.

The snippet that has to be used to check if “a” is not equal to “null” is

Question No# : 02 out of 20

How do you round the number 7.25, to the nearest integer?

Option A. round(7.25)
Option B. Math.rnd(7.25)
Option C. rnd(7.25)
Option D. Math.round(7.25)
True Answer D

Explanation :

How do you round the number 7.25, to the nearest integer?

Question No# : 03 out of 20



What is the output of this expression? x = 2 + "2"; document.write(x);

Option A. 22
Option B. 4
Option C. 2
Option D. syntax error
True Answer A

Explanation :

What is the output of this expression? x = 2 + "2"; document.write(x);

Question No# : 04 out of 20



The function definitions in JavaScript begins with

Option A. Identifier and Parantheses
Option B. Return type and Identifier
Option C. Return type, Function keyword, Identifier and Parantheses
Option D. Identifier and Return type
True Answer A

Explanation :
The function definitions begin with the keyword function followed by an identifier that names the function and a pair of parantheses around a comma-separated list of zero or more identifiers.

The function definitions in JavaScript begins with

Question No# : 05 out of 20

A hexadecimal literal begins with

Option A. 00
Option B. 0x
Option C. 0X
Option D. Both 0x and 0X
True Answer D

Explanation :
Generally, X or x denotes hexadecimal values. So, any integer literal that begins with 0X or 0x denotes a hexadecimal number.

A hexadecimal literal begins with

Question No# : 06 out of 20

How can you add a comment in a JavaScript?

Option A. <!--This is a comment-->
Option B. //This is a comment
Option C. 'This is a comment
Option D. #This is a comment
True Answer B

Explanation :

How can you add a comment in a JavaScript?

Question No# : 07 out of 20



JavaScript is designed for following purpose

Option A. To Perform Server Side Scripting Opertion
Option B. To Execute Query Related to DB on Server
Option C. To add interactivity to HTML Pages
Option D. To Style HTML Pages
True Answer C

Explanation :

JavaScript is designed for following purpose

Question No# : 08 out of 20



Javascript is _____ language

Option A. Client Side
Option B. Server Side
Option C. Both A and B
Option D. None of These
True Answer A

Explanation :

Javascript is _____ language

Question No# : 09 out of 20



Which of the following javascript functions are used to convert nonnumeric values into numbers?

Option A. Number()
Option B. parseFloat()
Option C. parseInt()
Option D. All of the above
True Answer D

Explanation :

Which of the following javascript functions are used to convert nonnumeric values into numbers?

Question No# : 10 out of 20



Which of the following is not a JavaScript datatype?

Option A. Boolean
Option B. String
Option C. Number
Option D. Function
True Answer D

Explanation :

Which of the following is not a JavaScript datatype?

Question No# : 11 out of 20



How do you write "Hello World" in an alert box?

Option A. alert("Hello World");
Option B. msgBox("Hello World");
Option C. alertBox("Hello World");
Option D. msg("Hello World");
True Answer A

Explanation :

How do you write "Hello World" in an alert box?

Question No# : 12 out of 20



Which operator is used to assign a value to a variable?

Option A. =
Option B. x
Option C. ==
Option D. *
True Answer A

Explanation :

Which operator is used to assign a value to a variable?

Question No# : 13 out of 20



How to write an IF statement in JavaScript?

Option A. if (i == 5)
Option B. if i == 5 then
Option C. if i = 5
Option D. if i = 5 then
True Answer A

Explanation :

How to write an IF statement in JavaScript?

Question No# : 14 out of 20



When there is an indefinite or an infinity value during an arithmetic value computation, javascript

Option A. Prints an exception error
Option B. Prints an overflow error
Option C. Displays “Infinity”
Option D. Prints the value as such
True Answer C

Explanation :
When the result of a numeric operation is larger than the largest representable number (overflow), the result is a special infinity value, which JavaScript prints as Infinity. Similarly, when a negative value becomes larger than the largest representable negative number, the result is negative infinity, printed as -Infinity. The infinite values behave as you would expect: adding, subtracting, multiplying, or dividing them by anything results in an infinite value (possibly with the sign reversed.

When there is an indefinite or an infinity value during an arithmetic value computation, javascript

Question No# : 15 out of 20

The type of a variable that is volatile is

Option A. Volatile variable
Option B. Mutable variable
Option C. Immutable variable
Option D. Dynamic variable
True Answer B

Explanation :
The variables whose values can be changed are called mutable variable types.

The type of a variable that is volatile is

Question No# : 16 out of 20

How do you find the number with the highest value of x and y?

Option A. ceil(x, y)
Option B. Math.max(x, y)
Option C. top(x, y)
Option D. Math.ceil(x, y)
True Answer B

Explanation :

How do you find the number with the highest value of x and y?

Question No# : 17 out of 20



How to find out the index of a particular character on a string

Option A. position()
Option B. index()
Option C. indexOf()
Option D. None of These
True Answer C

Explanation :

How to find out the index of a particular character on a string

Question No# : 18 out of 20



What is the correct JavaScript syntax to write "Hello World"?

Option A. System.out.println("Hello World")
Option B. println ("Hello World")
Option C. document.write("Hello World")
Option D. response.write("Hello World")
True Answer C

Explanation :

What is the correct JavaScript syntax to write "Hello World"?

Question No# : 19 out of 20



What is the alternate name for Java script?

Option A. LimeScript
Option B. ECMScript
Option C. Coffee Script
Option D. ECMAScript
True Answer D

Explanation :

What is the alternate name for Java script?

Question No# : 20 out of 20




CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad