Did you know? Unique Features of JScript | September 25th, 2008
Recently, I have been doing some research into where all the modern JavaScript engines stand in terms of implementation of ECMA 3 and in cross-polination of proprietary features. I came across some rather interesting features of Microsoft JScript that I sure as hell didn’t know, and maybe you didn’t either.
First of all, it’s worth noting that some of these features may originally have been written for the server platform and not the browser. Because the JScript engine is modular, Microsoft uses it in a lot of places. Thats also why you can do browser scripting in VBScript, much like you can write ASP pages in VBScript or JScript, and similarly for .NET.
Feature 1: Enumerator
Standard: JScript 3.0+
Support: Internet Explorer 4.0+
Syntax:
var myEnumObj = new Enumerator([collection])
Description: Enables enumeration of items in a collection. JScript Only.
Feature 2: VBArray
Standard: JScript 3.0+
Support: Internet Explorer 4.0+
Syntax:
var myVBArray = new VBArray(vbarr)
Description: Provides access to Visual Basic safe arrays.
Feature 3: Debug
Standard: JScript 3.0+
Support: Internet Explorer 4.0+
Syntax:
Debug.write(string);
Debug.writeln(string);
Description: Used for sending debug messages to Visual Studio or Microsoft Script debugger. Early version of Console.log!
Feature 4: JSON
Standard: JScript 5.8+, ECMAScript 3.1+
Support: Internet Explorer 8.0b2+
Syntax:
JSON.parse(text [, reviver])
JSON.stringify(obj)
Description: Provides methods to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.
The other day, this book ended up on Andre’s desk from O’Reilly: