{"action":"created","issue":{"url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/12","labels_url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/12/comments","events_url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/12/events","html_url":"https://github.com/coodict/javascript-in-one-pic/issues/12","id":91505190,"number":12,"title":"Why not differ between Expressions, Statements and prototypes?","user":{"login":"martensms","id":592637,"avatar_url":"https://avatars.githubusercontent.com/u/592637?v=3","gravatar_id":"","url":"https://api.github.com/users/martensms","html_url":"https://github.com/martensms","followers_url":"https://api.github.com/users/martensms/followers","following_url":"https://api.github.com/users/martensms/following{/other_user}","gists_url":"https://api.github.com/users/martensms/gists{/gist_id}","starred_url":"https://api.github.com/users/martensms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martensms/subscriptions","organizations_url":"https://api.github.com/users/martensms/orgs","repos_url":"https://api.github.com/users/martensms/repos","events_url":"https://api.github.com/users/martensms/events{/privacy}","received_events_url":"https://api.github.com/users/martensms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-27T19:31:10Z","updated_at":"2015-06-28T05:56:52Z","closed_at":null,"body":"I don't know if I like the representation of Objects and their data type categories. The issue I have in mind is mostly related to VM internals, such as Garbage Collection and memory allocation. For example, `var x = 3` will allocate runtime memory while `var x = new Number(3)` will allocate heap memory. Therefore, x must be cleared afterwards with the null trick or traced by the lifetime-GC.\r\n\r\nAlso, switch/case uses expressions, not statements. What does that mean? This is possible:\r\n\r\n```javascript\r\n\r\nvar myvariable = 'somecontent';\r\n\r\nswitch(myvariable) {\r\n    case (function() {\r\n      console.log('expression!');\r\n      return 'somecontent';\r\n    })():\r\n      console.log('It worked!');\r\n    break;\r\n}\r\n```\r\n\r\nSuch things are really hard to show when focussing on data types, as pretty much everything in ECMA is related to the difference of expressions and statements."},"comment":{"url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/comments/116202475","html_url":"https://github.com/coodict/javascript-in-one-pic/issues/12#issuecomment-116202475","issue_url":"https://api.github.com/repos/coodict/javascript-in-one-pic/issues/12","id":116202475,"user":{"login":"rainyear","id":3953966,"avatar_url":"https://avatars.githubusercontent.com/u/3953966?v=3","gravatar_id":"","url":"https://api.github.com/users/rainyear","html_url":"https://github.com/rainyear","followers_url":"https://api.github.com/users/rainyear/followers","following_url":"https://api.github.com/users/rainyear/following{/other_user}","gists_url":"https://api.github.com/users/rainyear/gists{/gist_id}","starred_url":"https://api.github.com/users/rainyear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rainyear/subscriptions","organizations_url":"https://api.github.com/users/rainyear/orgs","repos_url":"https://api.github.com/users/rainyear/repos","events_url":"https://api.github.com/users/rainyear/events{/privacy}","received_events_url":"https://api.github.com/users/rainyear/received_events","type":"User","site_admin":false},"created_at":"2015-06-28T05:56:52Z","updated_at":"2015-06-28T05:56:52Z","body":"@martensms Very good point of view! Comparing to books I've read, organizing this map/nodes picture according to Object types or data types is more like K&R, it can be used as a structured manual(or syntax cheat sheet). While `Expressions, Statements` reminds me of SICP, they're more abstract concepts that might not be easily explained in a map/nodes picture, but they are also very important and fundamental concepts that beginner in programming should  be clear of, for example, I've found that a beginner to Js had difficulty understanding the difference between following lines:\r\n\r\n```js\r\nvar p = {\r\n  name: 'github',\r\n};\r\nvar k = 'name';\r\n\r\np.k  // undefined\r\np.name // 'github'\r\np['name'] // 'github'\r\np[k] // 'github'\r\np['k'] // undefined\r\np[name]  // undefined\r\n```\r\n\r\nAnd it's extremely hard to explain the differences only according to this picture. The name of this project is `javascript in one pic` but it surely cannot(and will not) cover every corner of ECMA, VM memory allocation & GC will be shown in `Scope` or `Tips` or some other new nodes, if you have any idea about how to put the expressions & statements concepts into this picture, please let me know or make a pull request :pray:"}}