ES6 things

Date: 2018-11-19
// expand (spead) object
var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
    ...state,
    points: 120
}
// variable name as array index of param
// + Object.entries key/value loop
const b = {id: "mockId", name: "peter"}
Object.entries(b).map(([key, value]) => 
    console.log(`${key} : ${value}`)
)

 

16290cookie-checkES6 things