From b8d1e690f0abc015aab31d3ccc289e56ef40b034 Mon Sep 17 00:00:00 2001 From: Skubie Doo Date: Sun, 26 Mar 2017 15:55:52 -0400 Subject: [PATCH] Fix rest parameter mis-match I think you intended to have working code :smile: --- .../02-rest-parameters-spread-operator/article.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md b/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md index cbe60c43..edd9e600 100644 --- a/1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md +++ b/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 function showName(firstName, lastName, ...titles) { alert( firstName + ' ' + lastName ); // Julius Caesar - // the rest = ["Consul", "Imperator"] - alert( rest[0] ); // Consul - alert( rest[1] ); // Imperator - alert( rest.length ); // 2 + // the rest go into titles array + // i.e. titles = ["Consul", "Imperator"] + alert( titles[0] ); // Consul + alert( titles[1] ); // Imperator + alert( titles.length ); // 2 } showName("Julius", "Caesar", "Consul", "Imperator");