You can use Array.from or spread syntax (…).
Example:
const x = new Set([ 1, 2, 3, 4 ]);
const y = Array.from(x);
console.log(y); // = [ 1, 2, 3, 4 ]
const z = [ ...x ];
console.log(z); // = [ 1, 2, 3, 4 ]
More Related Contents:
- Null-safe property access (and conditional assignment) in ES6/2015
- Using Node.js require vs. ES6 import/export
- javascript extract certain properties from all objects in array
- Arrow Function in Object Literal [duplicate]
- Extending built-in natives in ES6 with Babel
- ES6 exporting/importing in index file
- Can’t require() default export value in Babel 6.x
- Why are Objects not Iterable in JavaScript?
- Browserify, Babel 6, Gulp – Unexpected token on spread operator
- Create object from array
- How to generate range of numbers from 0 to n in ES2015 only?
- Is there any one-line analogy in ES6 for ES5 `module.exports = require(‘./inner.js’)`?
- Using Objects in For Of Loops
- Why doesn’t instanceof work on instances of Error subclasses under babel-node?
- SyntaxError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’ – Gulp
- Extending Error in Javascript with ES6 syntax & Babel
- How to publish a module written in ES6 to NPM?
- JavaScript object destructuring and aliasing
- Extract certain properties from all objects in array
- Difference between import X and import * as X in node.js (ES6 / Babel)?
- spread operator vs array.concat()
- Unexpected comma using map()
- Replace element at specific position in an array without mutating it
- Find all values by specific key in a deep nested object
- Export multiple classes in ES6 modules
- How to create an array of objects from multiple arrays
- Array.from() vs spread syntax
- “unexpected token import” in Nodejs5 and babel?
- require(‘babel/register’) doesn’t work
- What is the technical definition of a Javascript iterable and how do you test for it?