Es6 extension operator query

< H1 > Ruan Yifeng: the extension operator (spread) is three dots (.). It is like the inverse operation of rest parameters, converting an array into a sequence of parameters separated by commas. < / H1 >

what does the inverse operation of rest parameters mean? what does
parameter sequence mean? What kind of data structure is it?

I want to know how the extension operator works

Feb.28,2021

there is no principle, it's just grammatical candy. The former spread you already know, the latter can search for the keyword "deconstruction".

there are many articles about these two things, and here is only one example

var arr = [1, 2, 3];

function test(...args) {
  console.log(args);
}

test(1, 2, 3);
// [ 1, 2, 3 ]

test(...arr);
// [ 1, 2, 3 ]

var [a, ...b] = arr;
// a = 1, b = [2, 3]

  1. when you look at the rest of the function section, you can use the form of function (.arr) {} to accept all the incoming things into the arr (the name is optional when you define it). Then the extension operator is the reverse process, spreading out the collected things again.
  2. A
  3. parameter sequence is something similar to arguments, which is a sequence containing function parameters--.
  4. I don't know how it is implemented at the bottom.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1beb70f-30fc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1beb70f-30fc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?