Câu hỏi phỏng vấn Nodejs
Câu hỏi

Name some Built-in Globals in Node.js

Câu trả lời

In Node.js, several built-in global objects are available across all modules without the need for importing them. Here are some of the key built-in globals in Node.js:

  1. global: This is the global namespace object, similar to the window object in browsers. It contains all other global objects[1][3].

  2. process: This object provides information about, and control over, the current Node.js process. It is an instance of EventEmitter and includes methods to exit the process, listen to process-wide events, and get environment information[1][3].

  3. console: Used for printing standard outputs and errors. It provides functionalities like console.log(), console.error(), and console.warn() to output information to the console[1][3][5].

  4. Buffer: Used to handle binary data. It can be used to create a new buffer instance which is a raw memory allocation outside the V8 heap[1][5].

  5. setImmediate(), clearImmediate(): These methods are used to schedule functions to execute after the current poll phase of the event loo...

junior

junior

Gợi ý câu hỏi phỏng vấn

junior

What are the benefits of using Node.js?

middle

What is the purpose of using assert module in Node.js

expert

What is the difference between cluster.fork() vs child_process.fork() in
Node.js?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào