Q. Every object contains three object attributes that are

  • (A) Prototype, class, object's extensible flag
  • (B) Prototype, class, objects' parameters
  • (C) Class, parameters, object's extensible flag
  • (D) Native object, Classes and Interfaces and Object's extensible flag
πŸ’¬ Discuss
βœ… Correct Answer: (A) Prototype, class, object's extensible flag

Q. What will be the output of the following JavaScript code?

Code:
<script>  
  
var article = {  
              "main title": "How to learn JavaScript",   
              'sub-title': "The Definitive Guide",   
              "for": "all audiences",   
              author: {   
firstname: "Scott",   
                         surname: "McCall"   
                      }  
           }  
</script> 
  • (A) Properties
  • (B) property names
  • (C) property values
  • (D) objects
πŸ’¬ Discuss
βœ… Correct Answer: (B) property names

Q. The linkage of a set of prototype objects is known as______

  • (A) prototype stack
  • (B) prototype
  • (C) prototype class
  • (D) prototype chain
πŸ’¬ Discuss
βœ… Correct Answer: (D) prototype chain

Q. In the following line of code, what we will call the "datatype" written in brackets?

Code:
article[datatype]=assignment_value;  
  • (A) An String
  • (B) A integer
  • (C) An object
  • (D) Floating point
πŸ’¬ Discuss
βœ… Correct Answer: (A) An String

Q. To know about an object, whether the object is a prototype (or a part of a prototype chain) of another object, the user can use_______

  • (A) ==operator
  • (B) equals() method
  • (C) === operator
  • (D) isPrototypeOf() method
πŸ’¬ Discuss
βœ… Correct Answer: (D) isPrototypeOf() method

Q. In the following given line of code, the prototype representing the_____

Code:
functionx(){};  
  • (A) Function x
  • (B) Prototype of a function
  • (C) A custom constructor
  • (D) Not valid
πŸ’¬ Discuss
βœ… Correct Answer: (B) Prototype of a function

Q. See the given code of JavaScript and choose the correct output from the following

Code:
var string1 = "40";  
varvalueinit=50;  
alert( string1 +intvalue);  
  • (A) 4090
  • (B) 90
  • (C) 4050
  • (D) Exception
πŸ’¬ Discuss
βœ… Correct Answer: (C) 4050

Q. In JavaScript, what will be used for calling the function definition expression

  • (A) Function prototype
  • (B) Function literal
  • (C) Function calling
  • (D) Function declaration
πŸ’¬ Discuss
βœ… Correct Answer: (B) Function literal

Q. Which of the following one is the property of the primary expression

  • (A) Contains only keywords
  • (B) basic expressions containing all necessary functions
  • (C) contains variable references alone
  • (D) stand-alone expressions
πŸ’¬ Discuss
βœ… Correct Answer: (D) stand-alone expressions

Q. Consider the following snippet of JavaScript code:
Which one of the following statement is most suitable to check if the pattern matches with the sting "text".

Code:
var text ="testing: 1, 2, 3";// Sample text  
var pattern =/\d+/g// Matches all instances of one or more digits.
  • (A) test(text)
  • (B) equals(pattern)
  • (C) test(pattern)
  • (D) text==pattern
πŸ’¬ Discuss
βœ… Correct Answer: (D) text==pattern