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

snowflake là gì

snowflake là gì? Năm 2010, Twitter có nguồn mở Snowflake, một thuật toán tạo ID duy nhất trên toàn cầu được sử dụng bởi nhóm nội bộ của nó, được dịch thành Snowflake.

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).

10 mẹo sử dụng array và object trong javascript

10 mẹo sử dụng array và object trong javascript