Please enable JavaScript.
Coggle requires JavaScript to display documents.
new features - Coggle Diagram
new features
destructuring
an easy way to assign variables, and extract variables from arrays and objects
assignment
[a,b, ...rest] = [100, 200, 300, 400, 500];
-
({ a, c, ...rest} = { a: 100, b: 200, c: 300, d: 400, e: 500 });
-
100 300 {b: 200, d: 400, e: 500}
arrays
const people = ['John', 'Beth', 'Mike'];
const [person1, person2, person3] = people;
functions
-
let person1, person2, person3;
[person1, person2, person3] = getPeople();
objects
-
const { name, age, city } = person;
iterators and generators
used to iterate through something, kind of like advanced loops
-
-
-
symbols
a primitive data type, part of the ES6 standard
-
-
-
maps
-
holds key value pairs, any type can be used as a key or value
const map1 = new Map();
-
map1.set(key1, "value of key1");
-
map1.set(key2, "value of key2");
console.log(map1.get(key1), map1.get(key2));
-
SETS
-
-
const set2 = new Set([100, "six", true]);
features
-
-
-
iterate
-
same for → set1.keys(), set1.values()
set1.entries()
→ returns iterable pairs [any, any]
-
-