125

I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript.

1
  • I'm sure it's already been pointed out, but IE, you can't use const keyword to declare variables: const MY_CONSTANT = 10;
    – dplante
    Jun 5, 2009 at 22:07

13 Answers 13

88

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.
2
39

As far as I can tell, two things:

  1. ActiveXObject constructor
  2. The idiom f(x) = y, which is roughly equivalent to f[x] = y.
2
  • 6
    The f(x) = y idiom bugs me the most! Why, oh why didn't they just go with f[x] = y...
    – Ates Goral
    Dec 15, 2008 at 16:42
  • 2
    MS needed to add their stamp in this era. That's how you know its good. Sep 13, 2016 at 14:21
20

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
  • 8
    This doesn't answer the question at all. The question is: "What are the differences between JavaScript and JScript". The correct answer is buried under several reiterations of the same thing. Sep 17, 2013 at 19:24
7

JScript is Microsoft's implementation of the ECMAScript specification. JavaScript is the Mozilla implementation of the specification.

7

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
  • 11
    Neither the languages are really identical, as outlined in another post.
    – EFraim
    Jul 28, 2009 at 7:04
4

JScript is the Microsoft implementation of Javascript

2
  • 47
    JScript is Microsoft's implementation of ECMAScript* Nov 5, 2012 at 23:50
  • why netscape did not made a lawsuit against microsoft for implementing javascript?
    – ezio
    Aug 29, 2022 at 13:18
4

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
  • 3
    @phrj: this is the Humpty Dumpty definition of "Open". AFAIK, it means "orthogonal".
    – Shog9
    Sep 27, 2008 at 20:26
  • 7
    Calling JScript "high-performance" back in the pre-V8 era makes one realize how far we have come.
    – Ray Toal
    Oct 9, 2011 at 22:38
  • 9
    The second list item looks like advertising material - "open implementation" actually means "you have to be open minded to accept it", and "high-performance" means "meant to be run on a high-performance machine". Sep 2, 2012 at 7:56
  • why netscape did not made a lawsuit against microsoft for implementing javascript?
    – ezio
    Aug 29, 2022 at 13:18
4

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.

3

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.

1

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.

0

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
  • 1
    Welcome to Stack Overflow! Please don't vandalize your posts. By posting on the Stack Exchange network, you've granted a non-revocable right, under the CC BY-SA 4.0 license, for Stack Exchange to distribute that content (i.e. regardless of your future choices). By Stack Exchange policy, the non-vandalized version of the post is the one which is distributed, and thus, any vandalism will be reverted.
    – cigien
    Jul 31, 2022 at 16:01
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Aug 2, 2022 at 9:28
-5

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
-8

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

3
  • 17
    Go easy on the bolds!
    – Jowen
    Apr 15, 2014 at 8:32
  • Why Java? You meant JavaScript. Dec 9, 2014 at 13:35
  • 1
    An important note for anyone that might not know: JavaScript and Java are not the same thing or related in any way. JavaScript was originally called LiveScript. But renamed to JavaScript to capitalize on the popularity of Java. Sharing the name is the extent of what they have in common aside from similarities with C like syntax languages.
    – Bacon Brad
    Jul 11, 2019 at 22:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.