Blog
Author Archive
Way to use a prototype (__proto__ property on an object):
function userCreator(new, score) {
const newUser = Object.create(userFunctionStore);
newUser.name
Read more…
Object literal
Dot notation
Object.create
// Create an empty object
const user3 = Object.create(null); // const user3 = {};
Generate an Object with a Function
Read more…
Rest Operator
Rest operator: collects all remaining elements into an array.
See the code example below:
function returnArr(…arr) {
return arr;
}
returnArr(1,2,3,4); // [1,2,3,4];
Spread Operator
Spread operator:
Read more…
Array destructuring is the assignment part of a variable, not the declaration part.
Destructured Array Code Examples
// Non-destructured code
function data() {
Read more…
Definition from MDN:
The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from
Read more…
To Top ↑