Javascript version on Android

I want to know the version of Javascript that WebView supports in Android 1.6.

Thanks in advance, Part Mehta

+3
source share
1 answer

All modern browsers support JavaScript 1.5, at least most support from 1.6 to 1.8.

This is not entirely useful. To get the exact version, you can test one new function in each version.

How can you do this? Create a test page to check the version of JavaScript and run it in the Android browser.

JavaScript 1.6 has many new Array features. 1.7 introduces Iterator objects. JavaScript 1.8 introduces the reduceArray function . Therefore, we can check them out:

var jsVersion = 1.5;
if (([]).forEach) jsVersion = 1.6;
if (window.Iterator) jsVersion = 1.7;
if (([]).reduce) jsVersion = 1.8;
+5

Source: https://habr.com/ru/post/1760258/


All Articles