I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript.
13 Answers
Just different names for what is really ECMAScript. John Resig has a good explanation.
Here's the full version breakdown:
- IE 6-7 support JScript 5 (which is equivalent to ECMAScript 3, JavaScript 1.5)
- IE 8 supports JScript 6 (which is equivalent to ECMAScript 3, JavaScript 1.5 - more bug fixes over JScript 5)
- Firefox 1.0 supports JavaScript 1.5 (ECMAScript 3 equivalent)
- Firefox 1.5 supports JavaScript 1.6 (1.5 + Array Extras + E4X + misc.)
- Firefox 2.0 supports JavaScript 1.7 (1.6 + Generator + Iterators + let + misc.)
- Firefox 3.0 supports JavaScript 1.8 (1.7 + Generator Expressions + Expression Closures + misc.)
- The next version of Firefox will support JavaScript 1.9 (1.8 + To be determined)
- Opera supports a language that is equivalent to ECMAScript 3 + Getters and Setters + misc.
- Safari supports a language that is equivalent to ECMAScript 3 + Getters and Setters + misc.
3 Comments
f(x) = y. See this question for more.let. Those are ES6 features that weren't added till much later. Firefox 2.0 is very old and doesn't even support ES5 let alone ES6.As far as I can tell, two things:
- ActiveXObject constructor
- The idiom f(x) = y, which is roughly equivalent to f[x] = y.
3 Comments
f(x) = y idiom bugs me the most! Why, oh why didn't they just go with f[x] = y...substr method.From Wikipedia: http://en.wikipedia.org/wiki/Jscript
JScript is the Microsoft dialect of the ECMAScript scripting language specification.
JavaScript (the Netscape/Mozilla implementation of the ECMA specification), JScript, and ECMAScript are very similar languages. In fact the name "JavaScript" is often used to refer to ECMAScript or JScript.
Microsoft uses the name JScript for its implementation to avoid trademark issues (JavaScript is a trademark of Oracle Corporation).
1 Comment
Javascript, the language, came first, from Netscape.
Microsoft reverse engineered Javascript and called it JScript to avoid trademark issues with Sun. (Netscape and Sun were partnered up at the time, so this was less of an issue)
The languages are identical, both are dialects of ECMA script, the after-the-fact standard.
Although the languages are identical, since JScript runs in Internet Explorer, it has access to different objects exposed by the browser (such as ActiveXObject)
1 Comment
There are some code differences to be aware of.
A negative first parameter to subtr is not supported, e.g. in Javascript: "string".substr(-1) returns "g", whereas in JScript: "string".substr(-1) returns "string"
It's possible to do "string"[0] to get "s" in Javascript, but JScript doesn't support such a construct. (Actually, only modern browsers appear to support the "string"[0] construct.
Comments
Long time ago, all browser providers were making JavaScript engines for their browsers and only they and god knew what was happening inside this. One beautiful day, ECMA international came and said: let's make engines based on common standard, let's make something general to make life more easy and fun, and they made that standard. Since all browser providers make their JavaScript engines based on ECMAScript core (standard).
For example, Google Chrome uses V8 engine and this is open source. You can download it and see how C++ program translates a command 'print' of JavaScript to machine code.
Internet Explorer uses JScript (Chakra) engine for their browser and others do so and they all uses common core.
Comments
JScript is the Microsoft implementation of Javascript
3 Comments
According to this article:
JavaScript is a scripting language developed by Netscape Communications designed for developing client and server Internet applications. Netscape Navigator is designed to interpret JavaScript embedded into Web pages. JavaScript is independent of Sun Microsystem's Java language.
Microsoft JScript is an open implementation of Netscape's JavaScript. JScript is a high-performance scripting language designed to create active online content for the World Wide Web. JScript allows developers to link and automate a wide variety of objects in Web pages, including ActiveX controls and Java programs. Microsoft Internet Explorer is designed to interpret JScript embedded into Web pages.
4 Comments
Wikipedia has this to say about the differences.
In general JScript is an ActiveX scripting language that is probably interpreted as JavaScript by non-IE browsers.
Comments
JScript and Javascript is TOTALLY different scripting languages. Javascript runs on the browser, but JScript can use ActiveX objects and has almost total control on your operating system if you've ran it, it can delete files, run or write files, download files from the web(via Powershell) run cmd commands etc. JScript is almost the same thing as VBScript, but has different syntax.
2 Comments
Jscript is a .NET language similar to C#, with the same capabilities and access to all the .NET functions.
JavaScript is run on the ASP Classic server. Use Classic ASP to run the same JavaScript that you have on the Client (excluding HTML5 capabilities). I only have one set of code this way for most of my code.
I run .ASPX JScript when I require Image and Binary File functions, (among many others) that are not in Classic ASP. This code is unique for the server, but extremely powerful.
1 Comment
JScript is Microsoft's equivalent of JavaScript.
Java is an Oracle product and used to be a Sun product.
Oracle bought Sun.
JavaScript + Microsoft = JScript
constkeyword to declare variables: const MY_CONSTANT = 10;