... cannot be used in anywhere.Only available in function parameters to "represent an indefinite number of arguments as an array".
function f(a, b, ...theArgs) {
// ...
}
3 Cases are available
1) For function calls:
myFunction(...iterableObj);
2) For array literals or strings:
[...iterableObj, '4', 'five', 6];
3) For object literals (new in ECMAScript 2018):
let objClone = { ...obj };