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

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.

Callback in javascript

Callback in javascript

promise in javascript

promise in javascript

kiểm tra email trong javascript

kiểm tra email trong javascript

Object.keys và Object.getOwnPropertyNames

Object.keys và Object.getOwnPropertyNames