- Home /
Is UnityScript the same as JScript?
Unity uses keywords like "extends" and "super" and "class". I see that these are part of JScript, and are very different than EcmaScript's "prototype".
Is Unity Javascript actually JScript, can I use the MSDN JScript reference?
Answer by Bunny83 · Mar 13, 2012 at 04:28 PM
No. UnityScript is a .NET language with a Javascript-like syntax. UnityScript implements nearly all features of .NET or Mono and therefore classes uses inheritance instead of prototyping.
Answer by CC Inc · Mar 13, 2012 at 06:09 PM
To quote a quote from wikipedia:
A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues
The big problem with the language "Javascript" is that there's not one Javascript. The actual standard is EC$$anonymous$$AScript but nearly all implementations are just javascript-like languages. $$anonymous$$icrosoft's JScript has some modifications and extentions that other Javascript implementations doesn't support, but there's no real standard besides EC$$anonymous$$A as far as i know.
Answer by rutter · Mar 13, 2012 at 04:31 PM
I've heard people compare the two, but I don't think they're close enough that you'll be able to use documentation as if they're identical.
The Unify Community Wiki has some pages, UnityScript versus JavaScript and Head First into Unity with UnityScript, which might be helpful.
There are some threads on the Unity forums about this topic, but I haven't seen any that seem to be especially authoritative.
Answer by Eric5h5 · Mar 13, 2012 at 04:46 PM
Unityscript is very similar to JScript.NET
(not JScript), and most if not all JScript.NET
code would work identically in Unity. Using the JScript.NET
reference is much more useful than Javascript, although keep in mind there are things in Unityscript that JScript.NET
doesn't have, such as generics.
can you give some examples of JScript.Net code that won't work in unity?