27 lines
464 B
TypeScript
27 lines
464 B
TypeScript
//// [iteratorSpreadInArray9.ts]
|
|
var array = [...new SymbolIterator];
|
|
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol()
|
|
};
|
|
}
|
|
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
//// [iteratorSpreadInArray9.js]
|
|
var array = [...new SymbolIterator];
|
|
class SymbolIterator {
|
|
next() {
|
|
return {
|
|
value: Symbol()
|
|
};
|
|
}
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|