We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a22c2a3 + b8d1e69 commit 3c6245bCopy full SHA for 3c6245b
1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md
@@ -53,10 +53,11 @@ Here the first two arguments go into variables and the rest goes to `titles` arr
53
function showName(firstName, lastName, ...titles) {
54
alert( firstName + ' ' + lastName ); // Julius Caesar
55
56
- // the rest = ["Consul", "Imperator"]
57
- alert( rest[0] ); // Consul
58
- alert( rest[1] ); // Imperator
59
- alert( rest.length ); // 2
+ // the rest go into titles array
+ // i.e. titles = ["Consul", "Imperator"]
+ alert( titles[0] ); // Consul
+ alert( titles[1] ); // Imperator
60
+ alert( titles.length ); // 2
61
}
62
63
showName("Julius", "Caesar", "Consul", "Imperator");
0 commit comments