Consider the following snippet code
var string1 = ”123 ”;
var intvalue = 123 ;
alert ( string1 + intvalue );
The result would be
A. 123246
B. 246
C. 123123
D. Exception
Select an option to see the answer and solution.
A function definition expression can be called
A. Function prototype
B. Function literal
C. Function definition
D. Function declaration
Select an option to see the answer and solution.
The property of a primary expression is
A. stand-alone expressions
B. basic expressions containing all necessary functions
C. contains variable references alone
D. complex expressions
Select an option to see the answer and solution.
Consider the following statements
var text = "testing: 1, 2, 3" ; // Sample text
var pattern = /d+/ g // Matches all instances of one or more digits
In order to check if the pattern matches with the string “text”, the statement is
A. text==pattern
B. text.equals(pattern)
C. text.test(pattern)
D. pattern.test(text)
Select an option to see the answer and solution.
The JavaScript’s syntax calling ( or executing ) a function or method is called
A. Primary expression
B. Functional expression
C. Invocation expression
D. Property Access Expression
Select an option to see the answer and solution.
What kind of an expression is “new Point(2,3)”?
A. Primary Expression
B. Object Creation Expression
C. Invocation Expression
D. Constructor Calling Expression
Select an option to see the answer and solution.
Which of the operator is used to test if a particular property exists or not?
A. in
B. exist
C. within
D. exists
Select an option to see the answer and solution.
Among the following, which one is a ternary operator?
Select an option to see the answer and solution.
“An expression that can legally appear on the left side of an assignment expression.” is a well known explanation for variables, properties of objects, and elements of arrays. They are called
A. Properties
B. Prototypes
C. Lvalue
D. Definition
Select an option to see the answer and solution.
JavaScript is a _______________ language
A. Object-Oriented
B. High-level
C. Assembly-language
D. Object-Based
Select an option to see the answer and solution.
The output for the following code snippet would most appropriately be
var a= 5 , b= 1
var obj = { a : 10 }
with( obj)
{
alert ( b)
} Select an option to see the answer and solution.
The output for the following code snippet would most appropriately be
var a= 5 , b= 1
var obj = { a : 10 }
with( obj)
{
alert ( b)
} Select an option to see the answer and solution.
A conditional expression is also called a
A. Alternate to if-else
B. Immediate if
C. If-then-else statement
D. None of the mentioned
Select an option to see the answer and solution.
Which is a more efficient code snippet ?
Code 1 :
for(var num= 10 ;num>= 1 ;num-- )
{
document . writeln ( num) ;
}
Code 2 :
var num= 10 ;
while( num>= 1 )
{
document . writeln ( num) ;
num++ ;
} A. Code 1
B. Code 2
C. Both Code 1 and Code 2
D. Cannot Compare
Select an option to see the answer and solution.
A statement block is a
A. conditional block
B. block that contains a single statement
C. Both conditional block and single statement
D. block that combines multiple statements into a single compound statement
Select an option to see the answer and solution.
When an empty statement is encountered, a JavaScript interpreter
A. Ignores the statement
B. Prompts to complete the statement
C. Throws an error
D. Throws an exception
Select an option to see the answer and solution.
The “var” and “function” are
A. Keywords
B. Declaration statements
C. Datatypes
D. Prototypes
Select an option to see the answer and solution.
Consider the following statements
switch( expression)
{
statements
}
In the above switch syntax, the expression is compared with the case labels using which of the following operator(s) ?
Select an option to see the answer and solution.
Consider the following statements
var count = 0 ;
while ( count < 10 )
{
console. log ( count) ;
count++ ;
}
In the above code snippet, what happens?
A. The values of count is logged or stored in a particular location or storage
B. The value of count from 0 to 9 is displayed in the console
C. An error is displayed
D. An exception is thrown
Select an option to see the answer and solution.
The enumeration order becomes implementation dependent and non-interoperable if :
A. If the object inherits enumerable properties
B. The object does not have the properties present in the integer array indices
C. The delete keyword is never used
D. Object.defineProperty() is not used
Select an option to see the answer and solution.