Search completed in 0.99 seconds.
Map.prototype[@@iterator]() - JavaScript
initial value of the entries method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax mymap[symbol.iterator] return value the map iterator function, which is the entries() function by default. ...
...value the map iterator function, which is the entries() function by default. ...
... ...
String.prototype[@@iterator]() - JavaScript
the
[@@iterator]() method returns a new iterator object that iterates over the code points of a string value, returning each code point as a string value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str[symbol.iterator] return value a new iterator object. ...
...es over the code points of a string value, returning each code point as a string value. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str[symbol.iterator] return value a new iterator object. ...
...ribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str[symbol.iterator] return value a new iterator object. examples using
[@@iterator]() var str = 'a\ud835\udc68'; var striter = str[symbol.iterator](); console.log(striter.next().value); // "a" console.log(striter.next().value); // "\ud835\udc68" using
[@@iterator]() with for..of var str = 'a\ud835\udc68b\ud835\udc69c\ud835\udc6a'; for (var v of str) { console.log(v); } // "a" // "\ud835\udc68" // "b" // "\ud835\udc69" // "c" // "\ud835\udc6a" specifications specification ecmascript (ecma-262)the definition of 'string.prototype
[@@iterator]()' in that specification. ...
Set.prototype[@@iterator]() - JavaScript
initial value of the values property. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax myset[symbol.iterator] return value the set iterator function, which is the values() function by default. ...
... syntax myset[symbol.iterator] return value the set iterator function, which is the values() function by default. examples using
[@@iterator]() const myset = new set(); myset.add('0'); myset.add(1); myset.add({}); const setiter = myset[symbol.iterator](); console.log(setiter.next().value); // "0" console.log(setiter.next().value); // 1 console.log(setiter.next().value); // object using
[@@iterator]() with for..of const myset = new set(); myset.add('0'); myset.add(1); myset.add({}); for (const v of myset) { console.log(v); } specifications specification ecmascript (ecma-262)the definition of 'set.prototype
[@@iterator]' in that specification. ...
Iterator - Archive of obsolete content
xt returns property_name only. description returns iterator instance that iterates over object. iterator instance returns [property_name, property_value] array for each iteration if keyonly is falsy, otherwise, if keyonly is truthy, it returns property_name for each iteration. if object is the iterator instance or generator instance, it returns object itself. properties iterator.prototype
[@@iterator] returns a function that returns iterator object. methods iterator.prototype.next returns next item in the [property_name, property_value] format or property_name only. it throws stopiteration if there are no more items. examples iterating over properties of an object var a = { x: 10, y: 20, }; var iter = iterator(a); console.log(iter.next()); // ["x", 10] console.log(iter.next()); ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
use symbol.iterator property (firefox 36) functions rest parameters (firefox 15) default parameters (firefox 15) parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments
[@@iterator] (firefox 46) other features binary and octal numeric literals (firefox 25) template strings (firefox 34) object initializer: shorthand property names (firefox 33) object initializer: computed property names (firefox 34) object initializer: shorthand method names (firefox 34) ...
MediaKeyStatusMap - Web APIs
read only returns a boolean asserting whether a value has been associated with the given key. mediakeystatusmap.keys() read only returns a new iterator object containing keys for each element in the status map, in insertion order. mediakeystatusmap.values() read only returns a new iterator object containing values for each element in the status map, in insertion order. mediakeystatusmap.
[@@iterator]() read only returns a new iterator object containing an array of [key, value] for each element in the status map, in insertion order. specifications specification status comment encrypted media extensionsthe definition of 'mediakeystatusmap' in that specification. recommendation initial definition. ...
The arguments object - JavaScript
arguments); // 'object' the type of individual arguments can be determined by indexing arguments: console.log(typeof arguments[0]); // returns the type of the first argument properties arguments.callee reference to the currently executing function that the arguments belong to. forbidden in strict mode. arguments.length the number of arguments that were passed to the function. arguments
[@@iterator] returns a new array iterator object that contains the values for each index in arguments. examples defining a function that concatenates several strings this example defines a function that concatenates several strings. the function's only formal argument is a string containing the characters that separate the items to concatenate. function myconcat(separator) { let args = array.prototype...
Array - JavaScript
method. array.prototype.tostring() returns a string representing the array and its elements. overrides the object.prototype.tostring() method. array.prototype.unshift() adds one or more elements to the front of an array, and returns the new length of the array. array.prototype.values() returns a new array iterator object that contains the values for each index in the array. array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples creating an array the following example creates an array, msgarray, with a length of 0, then assigns values to msgarray[0] and msgarray[99], changing the length of the array to 100. let msgarray = [] msgarray[0] = 'hello' msgarray[99] = 'world' if (msgarray.length === 100) { console.log('...
BigInt64Array - JavaScript
that contains the values for each index in the array. see also array.prototype.values(). bigint64array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). bigint64array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). bigint64array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.log(bigint64.length); // 2 console.log(bigint64.bytes_per_element); // 8 // from an array var arr = new bigint64array([21n,31n]); console...
BigUint64Array - JavaScript
at contains the values for each index in the array. see also array.prototype.values(). biguint64array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). biguint64array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). biguint64array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n console.log(biguint64.length); // 2 console.log(biguint64.bytes_per_element); // 8 // from an array var arr = new biguint64array([21n,31n]);...
Float32Array - JavaScript
ect that contains the values for each index in the array. see also array.prototype.values(). float32array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). float32array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). float32array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float32.length); // 2 console.log(float32.bytes_per_element); // 4 // from an array var arr = new float32array([21,31]); console.log(arr[1])...
Float64Array - JavaScript
ect that contains the values for each index in the array. see also array.prototype.values(). float64array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). float64array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). float64array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float64.length); // 2 console.log(float64.bytes_per_element); // 8 // from an array var arr = new float64array([21,31]); console.log(arr[1])...
Int16Array - JavaScript
or object that contains the values for each index in the array. see also array.prototype.values(). int16array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). int16array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). int16array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length); // 2 console.log(int16.bytes_per_element); // 2 // from an array var arr = new int16array([21,31]); console.log(arr[1]); // 31 // fro...
Int32Array - JavaScript
or object that contains the values for each index in the array. see also array.prototype.values(). int32array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). int32array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). int32array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length); // 2 console.log(int32.bytes_per_element); // 4 // from an array var arr = new int32array([21,31]); console.log(arr[1]); // 31 // fro...
Int8Array - JavaScript
rator object that contains the values for each index in the array. see also array.prototype.values(). int8array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). int8array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). int8array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2 console.log(int8.bytes_per_element); // 1 // from an array var arr = new int8array([21,31]); console.log(arr[1]); // 31 // from anothe...
Map - JavaScript
has(key) will return false afterwards. map.prototype.get(key) returns the value associated to the key, or undefined if there is none. map.prototype.has(key) returns a boolean asserting whether a value has been associated to the key in the map object or not. map.prototype.set(key, value) sets the value for the key in the map object. returns the map object. iteration methods map.prototype
[@@iterator]() returns a new iterator object that contains an array of [key, value] for each element in the map object in insertion order. map.prototype.keys() returns a new iterator object that contains the keys for each element in the map object in insertion order. map.prototype.values() returns a new iterator object that contains the values for each element in the map object in insertion order. map.p...
Set - JavaScript
om the set object. set.prototype.delete(value) removes the element associated to the value and returns the value that set.prototype.has(value) would have previously returned. set.prototype.has(value) will return false afterwards. set.prototype.has(value) returns a boolean asserting whether an element is present with the given value in the set object or not. iteration methods set.prototype
[@@iterator]() returns a new iterator object that yields the values for each element in the set object in insertion order. set.prototype.keys() returns a new iterator object that yields the values for each element in the set object in insertion order. (for sets, this is the same as the values() method.) set.prototype.values() returns a new iterator object that yields the values for each element in the se...
Symbol.iterator - JavaScript
ll request. description whenever an object needs to be iterated (such as at the beginning of a for..of loop), its @@iterator method is called with no arguments, and the returned iterator is used to obtain the values to be iterated. some built-in types have a default iteration behavior, while other types (such as object) do not. the built-in types with a @@iterator method are: array.prototype
[@@iterator]() typedarray.prototype
[@@iterator]() string.prototype
[@@iterator]() map.prototype
[@@iterator]() set.prototype
[@@iterator]() see also iteration protocols for more information. property attributes of symbol.iterator writable no enumerable no configurable no examples user-defined iterables we ca...
TypedArray - JavaScript
or object that contains the values for each index in the array. see also array.prototype.values(). typedarray.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). typedarray.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). typedarray.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples new is required starting with ecmascript 2015, typedarray constructors must be constructed with the new operator. calling a typedarray constructor as a function without new will throw a typeerror. var dv = int8array([1, 2, 3]); // typeerror: calling a builtin int8array constructor // without...
Uint16Array - JavaScript
object that contains the values for each index in the array. see also array.prototype.values(). uint16array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). uint16array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). uint16array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a uint16array // from a length var uint16 = new uint16array(2); uint16[0] = 42; console.log(uint16[0]); // 42 console.log(uint16.length); // 2 console.log(uint16.bytes_per_element); // 2 // from an array var arr = new uint16array([21,31]); console.log(arr[1]); // 31 ...
Uint32Array - JavaScript
object that contains the values for each index in the array. see also array.prototype.values(). uint32array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). uint32array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). uint32array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.length); // 2 console.log(uint32.bytes_per_element); // 4 // from an array var arr = new uint32array([21,31]); console.log(arr[1]); // 31 ...
Uint8Array - JavaScript
or object that contains the values for each index in the array. see also array.prototype.values(). uint8array.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). uint8array.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). uint8array.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length); // 2 console.log(uint8.bytes_per_element); // 1 // from an array var arr = new uint8array([21,31]); console.log(arr[1]); // 31 // from...
Uint8ClampedArray - JavaScript
ns the values for each index in the array. see also array.prototype.values(). uint8clampedarray.prototype.tolocalestring() returns a localized string representing the array and its elements. see also array.prototype.tolocalestring(). uint8clampedarray.prototype.tostring() returns a string representing the array and its elements. see also array.prototype.tostring(). uint8clampedarray.prototype
[@@iterator]() returns a new array iterator object that contains the values for each index in the array. examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]); // 42 console.log(uintc8[1]); // 255 (clamped) console.log(uintc8.length); // 2 console.log(uintc8.bytes_per_element); // 1 // from a...