{"action":"opened","issue":{"url":"https://api.github.com/repos/addyosmani/es6-equivalents-in-es5/issues/10","labels_url":"https://api.github.com/repos/addyosmani/es6-equivalents-in-es5/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/addyosmani/es6-equivalents-in-es5/issues/10/comments","events_url":"https://api.github.com/repos/addyosmani/es6-equivalents-in-es5/issues/10/events","html_url":"https://github.com/addyosmani/es6-equivalents-in-es5/issues/10","id":54686551,"number":10,"title":"Some question about the example of rest parameters.","user":{"login":"CoderK","id":1631348,"avatar_url":"https://avatars.githubusercontent.com/u/1631348?v=3","gravatar_id":"","url":"https://api.github.com/users/CoderK","html_url":"https://github.com/CoderK","followers_url":"https://api.github.com/users/CoderK/followers","following_url":"https://api.github.com/users/CoderK/following{/other_user}","gists_url":"https://api.github.com/users/CoderK/gists{/gist_id}","starred_url":"https://api.github.com/users/CoderK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CoderK/subscriptions","organizations_url":"https://api.github.com/users/CoderK/orgs","repos_url":"https://api.github.com/users/CoderK/repos","events_url":"https://api.github.com/users/CoderK/events{/privacy}","received_events_url":"https://api.github.com/users/CoderK/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-18T05:11:28Z","updated_at":"2015-01-18T05:11:28Z","closed_at":null,"body":"I think that the es5 example code in the rest parameters section can be shortened.\r\n\r\nAS is :\r\n```javascript\r\n\"use strict\";\r\n\r\nfunction f(x) {\r\n  var y = [];\r\n\r\n  for (var _key = 1; _key < arguments.length; _key++) {\r\n    y[_key - 1] = arguments[_key];\r\n  }\r\n\r\n  // y is an Array\r\n  return x * y.length;\r\n}\r\nconsole.log(f(3, \"hello\", true) == 6);\r\n// -> true\r\n```\r\n\r\nTo be : \r\n```javascript\r\nfunction f(x){\r\n    return x * (arguments.length - 1);\r\n}\r\n\r\nconsole.log(f(3, \"hello\", true) == 6);\r\n```\r\n\r\n\r\nDid you write some complicated code deliberately to let es6 syntax be emphasized?\r\n"}}