Node.js Test 1

0%

When there is no more data to read, the stream sends an end event.

Correct! Wrong!

Explanation:
When there is no more data to read, a stream fires an end event.

Which of the following statements concerning the global object __dirname is correct?

Correct! Wrong!

Explanation:
The __dirname specifies the name of the directory in which the currently running script is located.

Which of the following lines of code prints the amount of memory used?

Correct! Wrong!

Explanation:
To find out how much memory is being consumed, use process.memoryUsage().

Which of the following statements regarding Node.JS is correct?

Correct! Wrong!

Explanation:
Node.js is a powerful JavaScript-based framework/platform based on the JavaScript V8 Engine in Google Chrome. It is used to develop I/O-intensive online applications such as video streaming sites, single-page applications, and other websites. Thousands of developers use Node.js because it is open source and absolutely free.

Which of the following statements concerning the global function setTimeout(cb, ms) is true?

Correct! Wrong!

Explanation:
The global function setTimeout(cb, ms) is used to perform callback cb after at least ms milliseconds. The real delay is determined by external factors such as the granularity of the OS timer and the system load. A timer can only run for 24.8 days. The timer is represented by an opaque value returned by this function, which can be used to clear the timer.

Which of the following statements concerning the child process module's spawn method is correct?

Correct! Wrong!

Explanation:
The spawn() method returns streams after launching a new process with a supplied command (stdout, stderr).

Which of the following statements regarding the EventEmitter.on property is correct?

Correct! Wrong!

Explanation:
The event's on property is used to bind a function to it.

Which of the following statements regarding Chaining Streams is correct?

Correct! Wrong!

Explanation:
Chanining is a method of connecting the output of one stream to the output of another stream in order to build a chain of multiple stream operations. It's most commonly associated with piping operations.

Which of the following statements concerning external binding in terms of domain modules is correct?

Correct! Wrong!

Explanation:
In the case of external binding, the error emitter is explicitly added to a domain using its add method.

Premium Tests $49/mo
FREE November-2024