navigator.userAgent 只读属性返回包含运行时名称和主要版本号的用户代理信息。
navigator.userAgent
【The navigator.userAgent read-only property returns user agent consisting of the runtime name and major version number.】
console.log(`The user-agent is ${navigator.userAgent}`); // Prints "Node.js/21" 拷贝
console.log(`The user-agent is ${navigator.userAgent}`); // Prints "Node.js/21"