🌙 NodeJS之global全局变量学习笔记
🌙 1.global(全局变量)简介
所谓global(全局变量),即在所有的模块中都可用。 以下的变量虽然看似全局的,但实际上不是。 它们仅存在于模块的作用域中,参见模块系统的文档 (opens new window):
__dirname
(opens new window)__filename
(opens new window)exports
(opens new window)module
(opens new window)require()
(opens new window)
此处列出的对象特定于 Node.js。 有些内置对象 (opens new window)是 JavaScript 语言本身的一部分,它们也是全局可访问的。
🌙 2.全局变量
Buffer
🌙
clearImmediate(immediateObject)
🌙
clearInterval(intervalObject)
🌙
clearTimeout(timeoutObject)
setImmediate(callback[, ...args])
🌙
setInterval(callback, delay[, ...args])
🌙
setTimeout(callback, delay[, ...args])
🌙
console
🌙
global
🌙
process
🌙
queueMicrotask(callback)
🌙
TextDecoder
🌙
TextEncoder
🌙
URL
🌙
URLSearchParams
🌙
WebAssembly