{"action":"created","issue":{"url":"https://api.github.com/repos/gordonmzhu/beasts/issues/2","repository_url":"https://api.github.com/repos/gordonmzhu/beasts","labels_url":"https://api.github.com/repos/gordonmzhu/beasts/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/gordonmzhu/beasts/issues/2/comments","events_url":"https://api.github.com/repos/gordonmzhu/beasts/issues/2/events","html_url":"https://github.com/gordonmzhu/beasts/issues/2","id":196762193,"node_id":"MDU6SXNzdWUxOTY3NjIxOTM=","number":2,"title":"Improving runWithDebugger","user":{"login":"gordonmzhu","id":734575,"node_id":"MDQ6VXNlcjczNDU3NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/734575?v=4","gravatar_id":"","url":"https://api.github.com/users/gordonmzhu","html_url":"https://github.com/gordonmzhu","followers_url":"https://api.github.com/users/gordonmzhu/followers","following_url":"https://api.github.com/users/gordonmzhu/following{/other_user}","gists_url":"https://api.github.com/users/gordonmzhu/gists{/gist_id}","starred_url":"https://api.github.com/users/gordonmzhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gordonmzhu/subscriptions","organizations_url":"https://api.github.com/users/gordonmzhu/orgs","repos_url":"https://api.github.com/users/gordonmzhu/repos","events_url":"https://api.github.com/users/gordonmzhu/events{/privacy}","received_events_url":"https://api.github.com/users/gordonmzhu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":98,"created_at":"2016-12-20T19:41:39Z","updated_at":"2018-08-05T23:41:34Z","closed_at":null,"author_association":"OWNER","body":"In Practical JavaScript's \"Functions inside of functions\" interlude, we wrote a `runWithDebugger` function. However, this function has a very glaring deficiency. We can't pass arguments into the callback function.\r\n\r\nMore specifically, code like this works fine.\r\n\r\n```\r\nfunction sayHi() {\r\n  console.log('hi!');\r\n}\r\n\r\nrunWithDebugger(sayHi); // 'hi!'\r\n```\r\n\r\nBut it doesn't work with callback functions that take arguments like `sayHiTo` below.\r\n\r\n```\r\nfunction sayHiTo(name) {\r\n  console.log('hi ' + name);\r\n}\r\n```\r\n\r\nYour task is to rewrite `runWithDebugger` so it  can take an optional array that contains any arguments you want to pass into the callback function.\r\n\r\nMore specifically, your new and improved `runWithDebugger` should be able to do this.\r\n\r\n```\r\nrunWithDebugger(sayHiTo, ['gordon']); // 'hi gordon'\r\n```\r\n\r\nAnd of course, you should be able to pass multiple arguments into the array. Here's an example.\r\n\r\n```\r\nfunction sayFullName(first, last) {\r\n  console.log(first + ' '  + last);\r\n}\r\n\r\nrunWithDebugger(sayFullName, ['gordon', 'zhu']); // 'gordon zhu'\r\n```\r\n\r\nWhen you're done:\r\n\r\n1. Put your solution in a Gist (gist.github.com).\r\n2. Create a comment below and include a link to your Gist.\r\n\r\nGood luck!\r\n"},"comment":{"url":"https://api.github.com/repos/gordonmzhu/beasts/issues/comments/410556851","html_url":"https://github.com/gordonmzhu/beasts/issues/2#issuecomment-410556851","issue_url":"https://api.github.com/repos/gordonmzhu/beasts/issues/2","id":410556851,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDU1Njg1MQ==","user":{"login":"ravefalcon92","id":21224637,"node_id":"MDQ6VXNlcjIxMjI0NjM3","avatar_url":"https://avatars2.githubusercontent.com/u/21224637?v=4","gravatar_id":"","url":"https://api.github.com/users/ravefalcon92","html_url":"https://github.com/ravefalcon92","followers_url":"https://api.github.com/users/ravefalcon92/followers","following_url":"https://api.github.com/users/ravefalcon92/following{/other_user}","gists_url":"https://api.github.com/users/ravefalcon92/gists{/gist_id}","starred_url":"https://api.github.com/users/ravefalcon92/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravefalcon92/subscriptions","organizations_url":"https://api.github.com/users/ravefalcon92/orgs","repos_url":"https://api.github.com/users/ravefalcon92/repos","events_url":"https://api.github.com/users/ravefalcon92/events{/privacy}","received_events_url":"https://api.github.com/users/ravefalcon92/received_events","type":"User","site_admin":false},"created_at":"2018-08-05T23:41:34Z","updated_at":"2018-08-05T23:41:34Z","author_association":"CONTRIBUTOR","body":"Here is my solution:\r\n[](https://gist.github.com/ravefalcon92/1347096e908ef675c2824b55ed4dea27)\r\n\r\nI also included 3 tests I wrote so the simpletest file has been included as well. "}}
{"actor":{"display_login":"ravefalcon92"}}