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

closure javascript

closure javascript

Lấy tháng hiện tại trong javascript

Lấy tháng hiện tại trong javascript

Promise + gì

promise + gì

Remove array of objects from another array of objects

Remove array of objects from another array of objects

Đếm có bao nhiêu items giống nhau trong một array

reduce javascript. Đếm có bao nhiêu items giống nhau trong một array