Assume that we have to convert “false” that is a non-string to string. The command that we use is (without invoking the “new” operator).
a) false.toString()
b) String(false)
c) String newvariable=”false”
d) Both false.toString() and String(false)
A function definition expression can be called as………..
a) Function prototype
b) Function literal
c) Function calling
d) Function declaration
Explanation: A function definition expression is a “function literal” in the same way that an object initializer is an “object literal.” A Function definition expression typically consists of the keyword function followed by a comma-separated list of zero or more identifiers (the parameter names) in parentheses and a block of JavaScript code (the function body) in curly braces.
The property of a primary expression is……….
a) stand-alone expressions
b) basic expressions containing all necessary functions
c) contains variable references alone
d) contains only keywords
The expression of calling (or executing) a function or method in
JavaScript is called …..
a) Primary expression
b) Functional expression
c) Invocation expression
d) Property Access Expression
Explanation: An invocation expression is JavaScript’s syntax for calling (or executing) a function or method). It starts with a function expression that identifies the function to be called.
What kind of expression is “new Point(2,3)”?
a) Primary Expression
b) Object Creation Expression
c) Invocation Expression
d) Constructor Calling Expression
Explanation: An object creation expression creates a new object and invokes a function (called a constructor) to initialize the properties of that object. Object creation expressions are like invocation expressions except that they are prefixed with the keyword new.
Which of the operator is used to test if a particular property exists or not?
a) in
b) exist
c) within
d) exists
Explanation: The operator “in” tests whether a particular property exists or not. In operator is usually added in looping statements to traverse the array or the object.