Q3: What is negative infinity?
A4: ‘This’ keyword refers to the object from where it was called.
Q5: What is === operator?
A5: === is called as strict equality operator which returns true when the two operands are having the same value without any type conversion.
- do-while loops
Q9: What is the use of window object?
A9: The window object is automatically created by the browser that represents a window of a browser.
It is used to display the popup dialog box such as alert dialog box, confirm dialog box, input dialog box etc.
- Single Line Comment: It is represented by // (double forward slash)
- Multi Line Comment: It is represented by slash with asterisk symbol as /* write comment here */
- Primitive Data Types
- Non-primitive Data Types
- By array literal
- By creating instance of Array
- By using an Array constructor
Let’s see a simple code to create array using object literal.
A14: In Asynchronous programming, the engine runs in an event loop. On encountering a blocking operation, a request gets fired and the code keeps running without blocking for the result. When its execution completes, and the response is ready, it fires an interrupt, which causes an event handler to be run, where the control flow continues. In this way, a single program thread can handle many concurrent operations in an asynchronous programming.
The user interface is asynchronous by nature and spends most of the time, waiting for user input to interrupt the event loop and trigger event handlers. Node is asynchronous by default. It means that the server works by waiting for a network request in a loop. Thus, it accepts more incoming requests, while the first one is getting handled.
A17: To delete a Cookie, we have to set its expiry date to a time that occurred in the past. If attempts are made to read a deleted Cookie then, nothing is returned.
Q18: What is callback?
Q19: What is closure?
A19: Closures are created whenever a variable that is defined outside the current scope is accessed from within some inner scope.
Q20: Which built-in method sorts the elements of an array?
A20: sort() method sorts the elements of an array.
Q21: Which built-in method returns the characters in a string beginning at the specified location?
A21: substr() method returns the characters in a string beginning at the specified location through the specified number of characters.
A22: Reading a cookie is just as simple as writing one, because the value of the document.cookie object is the cookie. So you can use this string whenever you want to access the cookie.
The document.cookie string will keep a list of name = value pairs separated by semicolons, where name is the name of a cookie and value is its string value.
You can use strings’ split() function to break the string into key and values.
Q23: What is a prompt box?
A23: A prompt box is a box which allows the user to enter input by providing a text box. Label and box will be provided to enter the text or number.
A24: The NULL value is used to represent no value or no object. It implies no object or null string, no valid boolean value, no number and no array object.
Remember, in the interview, the company or the business or you can say the examiner often checks your basic knowledge of the subject. If your basics is covered and strengthened, you can have the job of your dream. The industry experts understand that if the foundation of the student is already made up, it is easy for the company to educate the employ towards advance skills. If there are no basics, there is no meaning of having learnt the subject.