ExamVeda
Login
Home
21
Which is a fast C++ based JavaScript interpreter?
Discuss
Answer & Solution
Answer: Option A
Solution:
Node is a fast C++-based JavaScript interpreter with bindings to the low-level Unix APIs for working with processes, files, network sockets, etc., and also to HTTP client and server APIs.
22
Why does the Node rely on event handlers?
Discuss
Answer & Solution
Answer: Option B
Solution:
Because the APIs are asynchronous, Node relies on event handlers, which are often implemented using nested functions and closures.
23
What is the command to run the node programs?
Discuss
Answer & Solution
Answer: Option C
Solution:
The node programs can be run with the command:
node program.js
24
What is the alternative command used in Node for load()?
Discuss
Answer & Solution
Answer: Option D
Solution:
Use require() instead of load(). It loads and executes (only once) the named module, returning an object that contains its exported symbols.
25
What is the command used for debugging output in Node?
Discuss
Answer & Solution
Answer: Option B
Solution:
Node defines console.log() for debugging output like browsers do.
26
What is the code to print hello one second from now?
Discuss
Answer & Solution
Answer: Option A
Solution:
The above code snippet says hello one second from now.
27
Among the below given functions, Node supports which of the following client-side timer functions?
Discuss
Answer & Solution
Answer: Option D
Solution:
Node supports the client-side timer functions set setTimeout(), setInterval(), clearTimeout(), and clearInterval().
28
The necessary globals of a node are defined under which namespace?
Discuss
Answer & Solution
Answer: Option C
Solution:
Node defines other important globals under the process namespace.
29
Why does Node not block while waiting for operations to complete?
Discuss
Answer & Solution
Answer: Option B
Solution:
Because Node’s functions and methods are asynchronous, they do not block while waiting for operations to complete.
30
Which is the method used for registering handlers?
Discuss
Answer & Solution
Answer: Option A
Solution:
Node objects that generate events (known as event emitters) define an on() method for registering handlers.