navigator.languages
- {Array
}
navigator.languages
只读属性返回一个字符串数组,表示 Node.js 实例的首选语言。默认情况下,navigator.languages
只包含 navigator.language
的值,该值将由 Node.js 在运行时使用的 ICU 库根据操作系统的默认语言确定。
¥The navigator.languages
read-only property returns an array of strings
representing the preferred languages of the Node.js instance.
By default navigator.languages
contains only the value of
navigator.language
, which will be determined by the ICU library used by
Node.js at runtime based on the default language of the operating system.
没有 ICU 的构建的后备值是 ['en-US']
。
¥The fallback value on builds without ICU is ['en-US']
.
console.log(`The preferred languages are '${navigator.languages}'`);