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

Hàm lày ngày trong tuần javascript

Hàm lày ngày trong tuần javascript

encode/decode base64 with JS

Encoding to base64 is done with the btoa command

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

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

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

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