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 loopCó thể bạn đã miss một số snippets code
Filter Unique Values
Kiểu đối tượng Set đã được giới thiệu trong ES6 và cùng với ..., ‘spread’ operator, chúng ta có thể sử dụng nó để tạo một mảng mới chỉ với các giá trị duy nhất.
Clone Objects in JavaScript
3 Ways to Clone Objects in JavaScript
using javascript callback style error handling
group by property javascript use reduce
group by property javascript use reduce
Object.keys và Object.getOwnPropertyNames
Object.keys và Object.getOwnPropertyNames