// We use the spread operator to spread array values or iterables into maybe an array or object.
// While we use the Rest operator to gather the remaining elements passed into a function as an array.
const myFunction = (name1, ...rest) => { // used rest operator here
console.log(name1);
console.log(rest);
};
let names = ["John", "Jane", "John", "Joe", "Joel"];
myFunction(...names); // used spread operator here