32

OK, so I'm trying to learn JavaScript properly so that I can write good, clean client-side code, but whenever I think I'm making progress, something stops me dead in my tracks!

I want to know:

  1. What is the different between JavaScript, ECMAScript and JScript?

  2. Which should I focus on learning?

  3. If these are versioned, which version should I be supporting?

  4. Are there any really good references (web / books etc) that are a must have/read?

  5. How do I ensure that what I write will be compliant with all major browsers (IE, FF, Safari, Chrome, Opera etc.) ?

  6. MOST IMPORTANTLY...Is there a reference of the core objects (Array, Number etc) so I know what is implemented already and what I need to do myself?

Thanks.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Matthew Layton
  • 39,871
  • 52
  • 185
  • 313
  • 6
    ECMAScript is a standard, of which JavaScript and JScript are two different implementations (or "dialects"). – BoltClock Aug 21 '12 at 08:39
  • 1
    Here is the same question: http://stackoverflow.com/questions/135203/whats-the-difference-between-javascript-and-jscript – Edson Medina Aug 21 '12 at 08:41
  • Wikipedia: JScript will answer a portion of your question if you just read the first part. – WhyNotHugo Aug 21 '12 at 08:43
  • The following question also somewhat duplicates this one: [What is the difference between JavaScript and ECMAScript?](https://stackoverflow.com/questions/912479/what-is-the-difference-between-javascript-and-ecmascript) – jotik Apr 10 '16 at 20:50
  • the best JavaScript/ECMAscript book I've ever found is called JavaScript: the Good Parts. written by Douglas Crockford, who popularized the JSON data format. a Google search for the book title will bring up a legal free copy somewhere in the first few results. – Mat Jones Aug 03 '17 at 12:24

6 Answers6

29

Javascript is the original name when the language was developed by Netscape.

JScript is Microsoft's name of their own implementation.

ECMAScript is the name of the language standard developed by ECMA, from the original Javascript implementation.

So, it's just one language, with different implementations.

The implementations of Javascript and JScript differ somewhat in what they support, but each version supports what's in the corresponding version of the ECMAScript standard. Generally you just use what's supported a few versions back, so that it works in all the browsers that are still in use.

One reference is the Mozilla Developer Network, as Mozilla is the current developer of Javascript. For each method and property you can find which version it is supported in.

JScript is documented at the Microsoft Developer Network, and has similar information about support. (Note that all Microsoft documentation is there, not only JScript, so for example you would need to search for "jscript array" rather than just "array".)

Using a library like jQuery is useful to avoid dealing with some of the compatibility problems between browsers.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
4
  1. ECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known dialects such as JavaScript, JScript, and ActionScript.

  2. Depends on you, but I think most commonly used for web dev is JavaScript

  3. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript

  4. I would recommend this book

  5. By learning more and more about the language itself and writing tests

  6. Look here

pkurek
  • 606
  • 4
  • 13
3

It is important to understand, that ECMAScript is a standard, defined in the last century. :D Whereas Javascript is derived from ECMAScript. Derived in a sense, that it implements the standard.

The big difference is, that Javascript actually only exists within the Browser, saying, it is by no means a standard in itself. Every browser can (and a lot do) implement it's own methods.

So, if you seriously want to learn it and write clean code, then IMHO you have to first get familiar with the ECMAScript standard.

To 3: Since Javascript is implemented by the browser, this really depends on what browsers you want to develop code for. Older browser may have to be dealt with trought some seperate handling in your code.

To 5: Again, javascript can check what browser (or what client software in general) requestet the page it is loaded in. Meaning: If bad comes to worse, you can deal with each browser seperately in your code. But most of the time they are pretty compliant (at least the later versions)

On 4 and 6 I'd have to check first for myself.

Hope I could help you out a bit.

Regards

LuigiEdlCarno
  • 2,410
  • 2
  • 21
  • 37
3
  1. ECMAScript is the language, JavaScript and JScript are dialects

  2. I would, personally, look at and learn JavaScript.

  3. It depends on what browsers you want to support, easily googled.

  4. MDN is a pretty good web source. JavaScript: The Good Parts and JavaScript: The Definitive Guide are both very good books, the first short and concise the latter very detailed.

  5. JavaScript libraries like jQuery is very good for this reason. It all comes down to learning all the quirks of the browsers. Google is your friend.

  6. MDN.

sQVe
  • 1,977
  • 12
  • 16
1
  1. Wikipedia please.
  2. Javascript is a language, this is probably what you want to learn rather than a spec.
  3. Welcome in hell, all. Modernizr and jQuery exists for a reason. Unless you are doing Javascript on the server side with Node.js for example, in this case you can focus on only one JS Engine (V8 for Node).
  4. MDN
  5. Test, Test, Test and re Test. Try never to use too recent features and use libraries.
  6. MDN tells you which browser supports what.
3on
  • 6,291
  • 3
  • 26
  • 22
1
  1. They're one and the same - for an history on JavaScript watch the Douglas Crockford webcasts on YouTube.

http://youtu.be/_DKkVvOt6dk http://youtu.be/hQVTIJBZook

2,3,4. Start with this http://eloquentjavascript.net/

  1. Libraries like jQuery do a good job in normalising behaviour across browsers.

  2. I think this is what you are looking for http://dochub.io/#javascript/

Paul Osborne
  • 1,550
  • 1
  • 10
  • 11