(A) What is JavaScript?
- a) JavaScript is a scripting language used to make the website interactive
- b) JavaScript is an assembly language used to make the website interactive
- c) JavaScript is a compiled language used to make the website interactive
- d) None of the mentioned
Answer: a) JavaScript is a scripting language used to make the website interactive
(b) Which of the following is correct about JavaScript?
- a) JavaScript is an Object-Based language
- b) JavaScript is Assembly-language
- c) JavaScript is an Object-Oriented language
- d) JavaScript is a High-level language
Answer: c) JavaScript is an Object-Oriented language
(c) which statement defines closures in JavaScript?
- a) JavaScript is a function that is enclosed with references to its inner function scope
- b) JavaScript is a function that is enclosed with references to its lexical environment
- c) JavaScript is a function that is enclosed with the object to its inner function scope
- d) None of the mentioned
Answer: b) JavaScript is a function that is enclosed with references to its lexical environment
(d)What will be the output of the following JavaScript code snippet?
- a) error
- b) Sanfoundry_ Javascriptmcq
- c) undefined
- d) Sanfoundry_Javascriptmcq
Answer: b) Sanfoundry_ Javascriptmcq
(e) Arrays in JavaScript are defined by which of the following statements?
- a) It is an ordered list of values
- b) It is an ordered list of objects
- c) It is an ordered list of strings
- d) It is an ordered list of functions
Answer: a) It is an ordered list of values
(f)Which of the following is the correct syntax to print a page using JavaScript?
- a) print();
- b) window.print();
- c) document.print();
- d) navigator.print();
Answer: b) window.print();
(g) Which of the following is not a JavaScript framework or library?
- a) React
b) Angular
c) Cassandra
d) Vue.js
Answer: c) Cassandra