21. let isSelected = true;
function setLevel(newLevel = 0) {
...
}
{ foo: foo, bar: bar } = { foo: bar, bar: foo};
22. class Person {
constructor(name) {
this.name = name;
}
describe() {
return "Person called " + this.name;
}
}
23. module Math {
export function sum(x, y) {
return x + y;
}
export var pi = 3.141593;
function internal() {
...
}
}
import Math.{sum, pi};
import Math.*;
24. for (var x of arr) {
console.log(x);
}
let squares = [ 1, 2, 3 ].map(x => x * x);