How can I understand what engine is being used while JavaScript is executing?
e.g., v8 or spidermonkey or nashhorn
How can I understand what engine is being used while JavaScript is executing?
e.g., v8 or spidermonkey or nashhorn
JavaScript engines (and their versions) are closely linked to browser (versions).
So simply use browser detection, and map it to the JS engine with a table. Many browsers even hold the engine build in their UA string.
Or better: Don't do it, for the very same reason. There's hardly a use case where you need to know the JS engine, apart from browser test suites (in which you just can ask the user). For anything else, you should use feature detection. Different engines differ in different ways from the ES spec, and you can test on these subtleties.