Basic And Variables(Javascript ) Questions and Answers
Explanation:-
Answer: Option B. -> prototype chainConsider an example, Date.prototype inherits properties from Object.prototype, so a Date object created by new Date() inherits properties from both Date.prototype and Object.prototype. This linked series of prototype objects is known as prototype chain.
Explanation:-
Answer: Option B. -> A StringWhen using square bracket notation, the expression inside the square brackets must evaluate to a sting or a value that can be converted to a string.
Explanation:-
Answer: Option C. -> property namesfirstname and surname are the property names. The value of that particular property is itself an object. That is why these property names are unquoted.
Explanation:-
Answer: Option C. -> Prototype, class, object’s extensible flagEvery object has three associated object attributes :
1. An object’s prototype is a reference to another object from which properties are inherited.
2. An object’s class is a string that caegorizes the type of an object.
3. An object’s extensible flag specifies whether new properties may be added to the object.
Explanation:-
Answer: Option A. -> isPrototypeOf() methodTo determine whether one object is the prototype of (or is part of the prototype chain of) another object, one should use the isPrototype() method. To find out if p is the prototype of o write p.isPrototypeOf(o).
Explanation:-
Answer: Option A. -> stand-alone expressionsThe simplest expressions, known as primary expressions, are those that stand alone — they do not include any simpler expressions. Primary expressions in JavaScript are constant or literal values, certain laguage keywords, and variable references.
Explanation:-
Answer: Option B. -> Function literalA 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.
Explanation:-
Answer: Option C. -> Invocation expressionAn 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.
Explanation:-
Answer: Option D. -> pattern.test(text)The given pattern is applied on the text given in the parenthesis.