Results 641 - 660 of 885

Legacy generator function expression

The function keyword can be used to define a legacy generator function inside an expression. To make the function a legacy generator, the function body should contain at least one yield expression.
JavaScript Legacy Iterator Reference Référence

Spread syntax

The spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) or multiple variables  (for destructuring assignment) are expected.
ECMAScript6 Iterator JavaScript operator Operator

const

This declaration creates a constant that can be either global or local to the function in which it is declared. An initializer for a constant is required; that is, you must specify its value in the same statement in which it's declared (which makes sense, given that it can't be changed later).
constants ECMAScript6 JavaScript Reference Statement

for each...in

The for each...in statement iterates a specified variable over all values of object's properties. For each distinct property, a specified statement is executed.
Deprecated E4X JavaScript Statement

function*

The function* declaration (function keyword followed by an asterisk) defines a generator function, which returns a Generator object.
ECMAScript6 Function Iterator JavaScript Statement

StringView

As web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using WebSockets, and so forth, it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data. In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() method to read the bytes from the data buffer.
Code snippet Guide JavaScript JavaScript typed arrays js-ctypes MDN JavaScript Libraries Sample code Typed Arrays WebGL WebSockets

ArrayBufferView

ArrayBufferView is a helper type representing any of the following JavaScript TypedArray types:
API Interface JavaScript Reference Référence Typed Arrays

BufferSource

BufferSource is a helper type representing objects that are either themselves an ArrayBuffer, or conform to ArrayBufferView.
API Interface JavaScript Reference Référence Typed Arrays

Uint8ClampedArray

The Uint8ClampedArray typed array represents an array of 8-bit unsigned integers clamped to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Constructor JavaScript TypedArray TypedArrays Uint8ClampedArray

Uint8Array

The Uint8Array typed array represents an array of 8-bit unsigned integers. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Constructor JavaScript TypedArray TypedArrays Uint8Array

The structured clone algorithm

The structured clone algorithm is a new algorithm defined by the HTML5 specification for serializing complex JavaScript objects. It's more capable than JSON in that it supports the serialization of objects that contain cyclic graphs — objects can refer to objects that refer to other objects in the same graph. In addition, in some cases, the structured clone algorithm may be more efficient than JSON.
Advanced DOM HTML5 JavaScript Reference Référence

Using Web Workers

A worker is an object created using a constructor (e.g. Worker()) that runs a named JavaScript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. Thus, using the window shortcut to get the current global scope (instead of self) within a Worker will return an error.
Advanced Firefox Guide HTML5 JavaScript Workers

Window

The window object represents a window containing a DOM document; the document property points to the DOM document loaded in that window. A window for a given document can be obtained using the document.defaultView property.
API DOM Interface JavaScript Reference Window

XDomainRequest

XDomainRequest is an implementation of HTTP access control (CORS) that worked in Internet Explorer 8 and 9. It was removed in Internet Explorer 10 in favor of using XMLHttpRequest with proper CORS; if you are targeting Internet Explorer 10 or later, or wish to support any other browser, you need to use standard HTTP access control.
AJAX API IE JavaScript Microsoft Obsolete Web

XDomainRequest.open()

Opens an XDomainRequest which is configured to use a given method (GET/POST) and URL.
AJAX IE JavaScript Method Microsoft Obsolete Reference

A re-introduction to JavaScript (JS tutorial)

Why a re-introduction? Because JavaScript is notorious for being the world's most misunderstood programming language. It is often derided as being a toy, but beneath its layer of deceptive simplicity, powerful language features await. JavaScript is now used by an incredible number of high-profile applications, showing that deeper knowledge of this technology is an important skill for any web or mobile developer.
CodingScripting Intermediate Intro JavaScript Learn Tutorial

Equality comparisons and sameness

Briefly, double equals will perform a type conversion when comparing two things; triple equals will do the same comparison without type conversion (by simply always returning false if the types differ); and Object.is will behave the same way as triple equals, but with special handling for NaN and -0 and +0 so that the last two are not said to be the same, while Object.is(NaN, NaN) will be true. (Comparing NaN with NaN ordinarily—i.e., using either double equals or triple equals—evaluates to false, because IEEE 754 says so.) Do note that the distinction between these all have to do with their handling of primitives; none of them compares whether the parameters are conceptually similar in structure. For any non-primitive objects x and y which have the same structure but are distinct objects themselves, all of the above forms will evaluate to false.
Comparison Equality Intermediate JavaScript Sameness SameValue SameValueZero

Expressions and operators

This chapter describes JavaScript's expressions and operators, including assignment, comparison, arithmetic, bitwise, logical, string, ternary and more.
beginner Beginner Expressions Guide JavaScript Operators

Classes

JavaScript classes are introduced in ECMAScript 6 are syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax is not introducing a new object-oriented inheritance model to JavaScript. JavaScript classes provide a much simpler and clearer syntax to create objects and deal with inheritance.
Classes Constructors ECMAScript6 Inheritance Intermediate JavaScript