flatMap()

array,tipjs

Use flatMap() creates a new array with sub-array elements flattened by specified depth.

[[2], [4], [6], [8]].flatMap(val => val/2) // [ 1, 2, 3, 4 ]

var new_array = arr.flatMap(function callback(currentValue[, index[, array]]) {
 // return element for new_array
}[, thisArg])

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

Async await in javascript

Async await in javascript

Remove array of objects from another array of objects

Remove array of objects from another array of objects

Kiểm tra phần tử trùng trong mảng JavaScript

Kiểm tra phần tử trùng trong mảng JavaScript.

Rolling loading

Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .

Copy a string to the clipboard

Copy a string to the clipboard. Only works as a result of user action (i.e. inside a click event listener).