JavaScript in Visual Studio

JavaScript is a first-class language in Visual Studio. You can use most or all of the standard editing aids (code snippets, IntelliSense, and so on) when you write JavaScript code in the Visual Studio IDE. You can write JavaScript code for many application types and services.

For the JavaScript language reference documentation, see JavaScript.

Specific versions of Visual Studio, or specific Visual Studio extensions, may be required to develop particular application types and services using HTML and JavaScript. The following list has links to more information.

The JavaScript editor in Visual Studio provides IntelliSense support. For more info, see JavaScript IntelliSense.

New features for JavaScript are listed in the following table.

Feature

Description

Classes

New syntax supports declaration of classes.

Promises

Promises allow easier and cleaner asynchronous coding. Promise constructors are supported, along with the all and race utility methods.

Iterators

Now you can iterate over iterable objects (including arrays, array-like objects, and iterators), invoking a custom iteration hook with statements to be executed for the value of each distinct property. For more information, see Iterators (JavaScript).

Note Note

Generators are not yet supported.

Arrow functions

The arrow function (=>) provides shorthand syntax for the function keyword which features a lexical this binding.

New methods for built-in objects

The Array Object (JavaScript), Math Object (JavaScript), Number Object (JavaScript), Object Object (JavaScript), and String Object (JavaScript) built-in objects include many new utility functions and properties for manipulating and inspecting data.

Object literal enhancements

Objects now support computed properties, concise method definitions, and shorthand syntax for properties whose value is initialized to a same-named variable. For more information, see Creating Objects (JavaScript).

Proxies

Proxies enable custom behavior for objects.

Rest parameters

Rest parameters allow you to turn consecutive arguments in a function call to an array. For more information, see Functions (JavaScript).

Spread operator

The spread operator () expands iterable expressions into individual arguments. For example, a.b(…array) is approximately the same as a.b.apply(a, array).

Symbols

Symbol objects allow properties to be added to existing objects with no possibility of interference with the existing object properties, with no unintended visibility, and with no other uncoordinated additions by other code.

Template strings

Template strings are string literals that allow for expressions to be evaluated and concatenated with the string literal.

Unicode enhancements

Improvements have been made to Unicode support. For example, a new escape sequence format supports astral code points (code points with more than four hexadecimal digits). For more information, see Special Characters (JavaScript).

WeakSet

A WeakSet is a collection of objects that will be garbage collected if they are not referenced anywhere else.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft