array expansion

1. Spread operator

The spread operator (spread) is three dots ( ...).

console.log(...[1, 2, 3])
// 1 2 3

console.log(1, ...[2, 3, 4], 5)
// 1 2 3 4 5

[...document.querySelectorAll('div')]

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325848379&siteId=291194637