# JScript .NET

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/JScript_.NET
> Markdown URL: https://mediated.wiki/source/JScript_.NET.md
> Source: https://en.wikipedia.org/wiki/JScript_.NET
> Source revision: 1319074114
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Programming language developed by Microsoft

This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages) This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (November 2013) (Learn how and when to remove this message) This article needs to be updated. Please help update this article to reflect recent events or newly available information. (June 2015) (Learn how and when to remove this message)

JScript .NET Paradigms Multi-paradigm: object-oriented (prototype-based), functional, imperative, scripting Family ECMAScript Developer Microsoft Corporation Typing discipline duck, weak, dynamic Scope lexical Platform .NET framework OS Microsoft Windows License proprietary Filename extensions .js File formats JScript .NET Influenced by JavaScript, JScript, ECMAScript

**JScript .NET** is a [.NET](/source/.NET) framework [programming language](/source/Programming_language) developed by [Microsoft](/source/Microsoft) as [proprietary software](/source/Proprietary_software).

The main differences between [JScript](/source/JScript) and JScript .NET can be summarized as:

Firstly, JScript is a [scripting language](/source/Scripting_language), and as such, [programs](/source/Computer_program) (or more suggestively, scripts) can be executed with no need to [compile](/source/Compiler) the code before. This is not the case with the JScript .NET [command-line interface](/source/Command-line_interface) compiler, since this next-generation version relies on the .NET [Common Language Runtime](/source/Common_Language_Runtime) (CLR) for execution, which requires that the code be compiled to [Common Intermediate Language](/source/Common_Intermediate_Language) (CIL), formerly named Microsoft Intermediate Language (MSIL), code before it can be run. Nevertheless, JScript .NET still fully supports [interpreting](/source/Interpreter_(computing)) [source code](/source/Source_code) at [runtime](/source/Execution_(computing)#Runtime) (e.g., via the Function constructor or the [eval](/source/Eval#JavaScript) function) and indeed the interpreter can be exposed by custom applications hosting the JScript .NET engine via the VSA[*[jargon](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#Technical_language)*] interfaces.

Secondly, JScript has a strong foundation in Microsoft's [ActiveX](/source/ActiveX) and [Component Object Model](/source/Component_Object_Model) (COM) technologies, and relies mainly on ActiveX components to provide much of its function (including database access via [ActiveX Data Objects](/source/ActiveX_Data_Objects) (ADO), file handling, etc.), whereas JScript .NET uses the [.NET](/source/.NET) framework to provide equivalent function. For backward-compatibility (or for where no .NET equivalent library exists), JScript .NET still provides full access to ActiveX objects via .NET and [COM Interop](/source/COM_Interop) using both the ActiveXObject constructor and the standard methods of the .NET Type class.

Although the .NET framework and languages such as [C#](/source/C_Sharp_(programming_language)) and [Visual Basic (.NET)](/source/Visual_Basic_(.NET)) have been adopted widely, JScript .NET has received little attention, from the media and developers. It is not supported in Microsoft's premier development tool, [Visual Studio .NET](/source/Visual_Studio_.NET). However, [ASP.NET](/source/ASP.NET) supports JScript .NET.

## Language differences

The following are prime examples of language differences between JScript .NET and other .NET languages, including comparisons.

### Differences with C#

- JScript .NET does not require an [entry point](/source/Entry_point) (main() [function](/source/Function_(computer_programming))) that an [operating system](/source/Operating_system) must call directly when executing a JScript .NET application, as such, JScript .NET program [control flow](/source/Control_flow) can be based on global code.

- JScript .NET, because of its very loose [data type](/source/Data_type) checking system, can be easier to learn, since the common convention of [declaring](/source/Declaration_(computer_programming)) types explicitly is unneeded.

- JScript .NET does not require explicit references to the .NET framework Base Class Library, as certain functions found in earlier versions of JScript are present in JScript .NET (e.g., functions for finding the [tangent](/source/Trigonometric_function) of an angle for a [right triangle](/source/Right_triangle)).

- JScript .NET is closely linked to [C syntax](/source/C_syntax), and is thus easy to learn for [C#](/source/C_Sharp_(programming_language)), [Java](/source/Java_(programming_language)), or [C++](/source/C%2B%2B) developers.

- While JScript .NET can be used to create Windows Forms applications, it can have some trouble, as delegates can only be consumed in JScript .NET and not created. Thus, custom events are hard to emulate in JScript .NET.

### Differences with C++

- JScript .NET does not need a [main()](/source/Entry_point) [function](/source/Function_(computer_programming)).

- JScript .NET does not need explicit [type declaration](/source/Type_declaration) on variables. (In [C++](/source/C%2B%2B), the use of templates and generics can be compared to this, loosely emulated with template specialization, etc.)

- JScript .NET does not need explicit [type casts](/source/Type_conversion) on variable use in the program. Code used to retrieve a string of characters, but only used for integer numbers can be cast implicitly; the vice versa can be done without error at [compile time](/source/Compile_time), but there is a chance of loss of precision or data.

e.g.:

import System;

Console.WriteLine("Hello, what's your name?");
Console.WriteLine("Type your name: ");

var name: String = Console.ReadLine();

Console.WriteLine($"Hello, {name}");

### Differences with Java

- JScript .NET syntax and lexical conventions are similar to [Java](/source/Java_(programming_language)) in that both are derived from [C](/source/C_(programming_language)). JScript was originally Microsoft's implementation of [ECMAScript](/source/ECMAScript), which is more commonly known as [JavaScript](/source/JavaScript), though it is unrelated to Java. Thus, users of Java and other C-derived languages will find JScript easier to learn.

- JScript .NET allows developers to use [untyped variables](/source/Variable_(computer_science)#Typing), and can sometimes infer their type from their usage to optimize the compiled code. On the other hand, Java requires all variables to be typed, though Java also supports type inference.

- JScript .NET can add properties and methods to objects in [run-time](/source/Run_time_(program_lifecycle_phase)), while Java objects always conform to their declared interface.

- JScript .NET supports [global variables](/source/Global_variables), which Java does not.

### Differences with older versions of JScript

- JScript .NET allows declaring variables and functions with type information (e.g., var x: String;), while type information for JScript's variables and functions cannot be declared (e.g., var x;).

- JScript .NET scripts are not interpreted, but executed independently. When executed, a JScript .NET application will invoke the [CLR](/source/Common_Language_Runtime). The CLR will execute the [CIL](/source/Common_Intermediate_Language) instructions without using an interpreter.

- JScript .NET can be run without the presence of a browser or another [scripting engine](/source/Scripting_language) as the compiler can generate standalone [executables](/source/Executable) and assemblies. However these still require [.NET](/source/.NET) framework to be installed to run.

- JScript .NET provides access to the .NET framework [Base Class Library](/source/Base_Class_Library) (BCL), providing much more function.

- JScript .NET is available as a scripting language for only [ASP.NET](/source/ASP.NET), the technology used to generate web pages. Thus, JScript .NET has a role similar to [PHP](/source/PHP) and other [server-side](/source/Client%E2%80%93server_model) scripting languages. Internet Explorer, however, still uses only the older JScript engine, so JScript.NET cannot be used to script web pages (or [HTML Applications](/source/HTML_Application) (HTAs), or HTCs). In this regard, JScript is much more versatile than JScript .NET.

## See also

- [JS++](/source/JS%2B%2B)

- [TypeScript](/source/TypeScript)

- [JavaScript OSA](/source/JavaScript_OSA) – system-level scripting language for [Apple](/source/Apple_Inc.) [Macintosh](/source/Mac_(computer))

- [JScript](/source/JScript)

- [ActionScript](/source/ActionScript)

- [C#](/source/C_Sharp_(programming_language))

## Notes

## References

- [Getting Started With JScript .NET](http://msdn.microsoft.com/en-us/library/3bf5fs13.aspx)

- [Introducing JScript .NET](http://msdn.microsoft.com/en-us/library/ms974588.aspx)

- [JScript.NET tutorial and form tutorial](https://web.archive.org/web/20091027083329/http://geocities.com/Jeff_Louie/jscript_net_windows_form.htm)

v t e Common Language Infrastructure Architecture Application domain Code Access Security Common Intermediate Language instructions Common Type System Platform Invocation Services Virtual Execution System Components Assembly Delegate Global Assembly Cache Manifest Metadata Standard Libraries Implementations Microsoft .NET .NET Framework .NET Compact Framework .NET Micro Framework Other Mono DotGNU Languages Major C# Visual Basic F# PowerShell Other Axum A# Boo Clojure Cobra C++/CLI IronScheme IronPython IronRuby JScript .NET J# Nemerle Oxygene Phalanger Q# Scala Small Basic Comparison C# and Java C# and Visual Basic .NET Visual Basic and Visual Basic .NET

v t e ECMAScript Dialects ActionScript Haxe Bosque Caja JavaScript engines asm.js JS++ JScript JScript .NET QtScript Solidity TypeScript WMLScript Engines Carakan Futhark JavaScriptCore JScript KJS Linear B QtScript Rhino SpiderMonkey TraceMonkey JägerMonkey Tamarin V8 ChakraCore Chakra JScript .NET Nashorn Frameworks Client-side Dojo Echo Ext JS Google Web Toolkit jQuery Lively Kernel midori MochiKit MooTools Prototype qooxdoo SproutCore Spry Wakanda Framework Server-side Node.js Deno Bun GraalJS Jaxer AppJet WakandaDB Multiple Cappuccino Libraries Backbone.js SWFObject Underscore.js People Brendan Eich Douglas Crockford John Resig Scott Isaacs Other DHTML Ecma International JSDoc JSGI JSHint JSLint JSON JSSS Sputnik SunSpider Asynchronous module definition CommonJS Lists: JavaScript libraries • Ajax frameworks • Server-side JavaScript Comparison: JavaScript web frameworks

---
Adapted from the Wikipedia article [JScript .NET](https://en.wikipedia.org/wiki/JScript_.NET) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/JScript_.NET?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
