I have been using JavaScript in Windows Scripting, both in .JS files and .WSF files, for several years, but I have found that there are some methods that are not recognized when I put them in a script that is executed outside a web page that are valid in a script on a web page. I know that different browsers support different versions of JavaScript, and MSDN has a page that describes which functions and methods are supported in which Internet Explorer and Edge browser versions:
https://learn.microsoft.com/en-us/scripting/javascript/reference/javascript-version-information
but it does not say which methods are supported in Windows Scripting.
Does the version of JavaScript supported in Windows Scripting depend on the version of Windows, the version of Internet Explorer installed on the computer, or some other factor or combination of factors? Is there a way inside the JavaScript program to detect which version of JavaScript is being used as it is executed?
Date.now()
query, according to MDN web docs it "method was standardized in ECMA-262 5th edition" which might explain its absence from JScript which was originally based on ECMA-262 3rd edition. The docs do provide a workaround in the form of a shim forDate.getTime()
though. – Webber