es6 typescript code example
Example 1: some js es6
const array = [1, 2, 3, 4, 5];
// checks whether an element is even
const even = (element) => element % 2 === 0;
console.log(array.some(even));
// expected output: true
Example 2: using es6 set in typescript
const [elements, setElements] = useState<Set<string>>(new Set())
Example 3: es6 functions
const add = (n1, n2) => n1 + n2
Example 4: es6 module syntax
es6 module syntax