Q1. What are the three important manipulations done in for loop on a loop variable?
Updation, Incrementation, Initialization
Initialization, Testing, Updation
Testing, Updation, Testing
Initialization, Testing, Incrementation
Correct Answer: A Explanation: In for loop, firstly the loop initializes the variable then test the condition and then after executing the statement increments its value.
Q2. A function definition expression can be called as:
Q4. The script tag must be placed in __________
the head tag
the head or body
the title or head
after the body tag
Correct Answer: B Explanation: If the script tag is placed after the body tag, then, it will not be evaluated at all. Also, it is always recommended and effective to use the script snippet in the <head> tag.
Q5. The four kinds of class members are ________
Instance methods, Instance fields, Static method, Dynamic method
Instance fields, Instance methods, Class fields, Class methods
Instance fields, Non-instance fields, Dynamic methods, Global methods
Global methods, Local methods, Dynamic methods, Static methods
Correct Answer: B Explanation: A class mainly contains data members and associated member functions. Therefore over all different kinds of class members are instance field, instance method, class fields and class methods.
Q6. The scope of a function is also called as ________
Correct Answer: B Explanation: The scope of a function can be used as a private namespace for a module. Therefore, the scope of a function is called a module function.
There is no difference
Functions are considered as fields
Variables are specific
Functions are values, and there is no hard distinction between methods and fields
Correct Answer: D
Q8.The regular expression to match any one character not between the brackets is:
Correct Answer: C
Explanation: RegExp defines a special set of character that is used to do manipulation on strings and other variables. The [^…] character class is used to match or draw any one character not between the brackets
Q9. What are the events generated by the Node objects called?
Correct Answer: B Explanation: There are two classes of events one is called event listener and the other is called event emitter. Node objects that generate events (known as event emitters) define an on() method for registering handlers.
Q10. Which of the following is an event emitter?
Correct Answer: B Explanation: The process object is an event emitter. The Node defines other important global under the process namespaces that contain properties of that object like version, argv, env, pid, getuid(), cwd(), chdir() and exit().
Q11.Which is the function used to retrieve a value?
Correct Answer: C Explanation: To retrieve a value, pass the name to getItem(). The getItem() method of the Storage interface, when passed a key name, will return that key’s value, or null if the key does not exist, in the given Storage object
Q12. What is the method used to pause “data” events?
Correct Answer: A
Explanation: Data events are the events which are performed by either the user or the browser.
Both onhalt and onerror
Correct Answer: B
Q14.The paragraph “p” is a part of __________
d) both body and html
Correct Answer: D Explanation: The paragraph tag belongs to both html and body tag. It is used to write paragraph on html pages.
Q15. The URL property belongs to which of the following object?
Correct Answer: A
Explanation: The Document object has a URL property, which is a static string that holds the URL of the document when it was first loaded. If you want to access any element in an HTML page, you always start with accessing the document object.
Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions with detailed explanations to ensure the best placement preparation.