Đếm số phần tử trong mảng JavaScript
tipjs,es6
Đếm số phần tử trong mảng JavaScript trùng nhau
var count = 0;
for(var i = 0; i < array.length; ++i){
if(array[i] == 2)
count++;
}
Có thể bạn đã miss một số snippets code
Remove item in array javascript es6
Những bạn nào mà đã sử dụng ES6 một thời gian rồi thì có thể sử dụng method array.filter()
Lodash sort - Test performance with native js
Lodash sort - Bài viết ngắn gọn muốn đưa ra con số sau khi test về Lodash và Native js. Đây chỉ là check trên phương diện cá nhân...
Merge Array
How to combine two sorted arrays into one? We can do this easily with the spread operator.
Rest Operator for Objects
Now we can use rest on the properties of an Object. It allows us to explicitly extract certain named variables, and assign any uncalled variables into a catchall Object.
using async/await to catch errors