Object:
let obj = {
attr1: 'attr1',
attr2: 123
}
Getters/Setters:
obj.attr1 = 'attr1'
var attr1 = 'attr1'
obj[attr1] = 'attr1'
Array as object:
let array = ['one','two',3]
let ele1 = array[0]
let num = array[2]
Function:
function func(var1) {
console.log(var1);
}
Set const from output of anonymous function
const newArray = (() => {
return baseArray.map (
m => {
return { new_id : m.id, new_name : m.name }
}
)
}) ()
Printing using forEach:
<div>
{newArray.map((m) => <p>{m.new_name}</p>)}
</div>
Fetching from a URL
fetch(URL).then (res => res.text())
.then(text => {)...
Pattern Matching
Place Holder