Convert Array-like to True Array

object,array,tipjs

This is cool! Learning something new @wesbos ES6 course 🔥

const nodeList = document.querySelectorAll('ul li');

// Method 1: Convert to true Array
Array.from(nodeList);

// Method 2: Convert to true Array
[...nodeList];

// Now you can use map and other methods to loop

Có thể bạn đã miss một số snippets code

Converting Object to an Array

Converting Object to an Array

using Typescript callback style error handling

Async await in javascript

Async await in javascript

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.