Javascript: Rest Parameter Posted on 2022-05-18 Edited on 2024-02-20 In Javascript 123456789101112131415// rest.jsconst row = { name: "Amy", age: 32, email: "amy@gamil.com", job: "cook"};const { job: a, none: b, ...rest_props } = row;console.log(a); // maps to property "job"console.log("---")console.log(b); // property "none" doesn't exist so b is undefinedconsole.log("---")console.log(rest_props); // row but without "job" property run the code: 123456$ node rest.js cook---undefined---{ name: 'Amy', age: 32, email: 'amy@gamil.com' } More rest parameter is not spread syntax https://www.freecodecamp.org/news/javascript-rest-vs-spread-operators/ JavaScript 里三个点 … 的用法