practice
Array
let csvFileLine = '1997,John Doe,US,john@doe.com,New York'
let { 2: country, 4: state } = csvFileLine.split(',')
//交换参数数值
let param1 = 1
let param2 = 2
;[param1, param2] = [param2, param1]
//接收函数返回的多个结果
let getFullPost = async () => {
return await Promise.all([fetch('/post'), fetch('/comments')])
}
let [post, comments] = getFullPost()//arr only includes undefined、null、boolean、string、number
let array = [1, 1, 2, '3', false, undefined, null, NaN, '', 0]
let uniqueArr = [...new Set(array)]
let a = Array.from(new Set(array))Object
Function
String
Number
Boolean
Data Convert
Promise
Date
DOM
Code
Mis
Last updated