Module4: Using the Spread Operator
parent
d822050bdc
commit
2a5ef56d42
9
app.js
9
app.js
|
@ -1,5 +1,6 @@
|
||||||
function greet(...names, message) { // SyntaxError generated
|
function display(char1, char2, char3, char4, ...others) {
|
||||||
console.log(message + ' everyone!');
|
console.log(others);
|
||||||
names.forEach(name => console.log('Hi ' + name));
|
console.log(char1, char2, char3, char4);
|
||||||
}
|
}
|
||||||
greet('Welcome', 'Mary', 'John', 'James');
|
let letters = 'abcdefgh';
|
||||||
|
display(...letters);
|
Loading…
Reference in New Issue