{"action":"created","issue":{"url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/686","repository_url":"https://api.github.com/repos/getify/You-Dont-Know-JS","labels_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/686/labels{/name}","comments_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/686/comments","events_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/686/events","html_url":"https://github.com/getify/You-Dont-Know-JS/issues/686","id":140487854,"number":686,"title":"Distinguish declaration vs. expression functions.","user":{"login":"oldergod","id":1767669,"avatar_url":"https://avatars.githubusercontent.com/u/1767669?v=3","gravatar_id":"","url":"https://api.github.com/users/oldergod","html_url":"https://github.com/oldergod","followers_url":"https://api.github.com/users/oldergod/followers","following_url":"https://api.github.com/users/oldergod/following{/other_user}","gists_url":"https://api.github.com/users/oldergod/gists{/gist_id}","starred_url":"https://api.github.com/users/oldergod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oldergod/subscriptions","organizations_url":"https://api.github.com/users/oldergod/orgs","repos_url":"https://api.github.com/users/oldergod/repos","events_url":"https://api.github.com/users/oldergod/events{/privacy}","received_events_url":"https://api.github.com/users/oldergod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-13T14:00:19Z","updated_at":"2016-03-14T01:28:32Z","closed_at":null,"body":"The book says at the [third chapter](https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20&%20closures/ch3.md#functions-as-scopes) of _Scope and Closures_:\r\n\r\n> **Note**: The easiest way to distinguish declaration vs. expression is the position of the word \"function\" in the statement (not just a line, but a distinct statement). If \"function\" is the very first thing in the statement, then it's a function declaration. Otherwise, it's a function expression.\r\n\r\nBut on [MDN#functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions#Examples) it is said that \"_[if a function declaration is a nested] statement in the script or a function body[, then it is a function expression]_\" which would be a exception of the rule in the book from above."},"comment":{"url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/comments/196097858","html_url":"https://github.com/getify/You-Dont-Know-JS/issues/686#issuecomment-196097858","issue_url":"https://api.github.com/repos/getify/You-Dont-Know-JS/issues/686","id":196097858,"user":{"login":"getify","id":150330,"avatar_url":"https://avatars.githubusercontent.com/u/150330?v=3","gravatar_id":"","url":"https://api.github.com/users/getify","html_url":"https://github.com/getify","followers_url":"https://api.github.com/users/getify/followers","following_url":"https://api.github.com/users/getify/following{/other_user}","gists_url":"https://api.github.com/users/getify/gists{/gist_id}","starred_url":"https://api.github.com/users/getify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getify/subscriptions","organizations_url":"https://api.github.com/users/getify/orgs","repos_url":"https://api.github.com/users/getify/repos","events_url":"https://api.github.com/users/getify/events{/privacy}","received_events_url":"https://api.github.com/users/getify/received_events","type":"User","site_admin":false},"created_at":"2016-03-14T01:28:32Z","updated_at":"2016-03-14T01:28:32Z","body":"MDN is incorrect. function declarations inside blocks are still declarations."}}