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?
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?
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.
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.
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.