{"action":"created","comment":{"url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/comments/22912868","id":22912868,"diff_hunk":"@@ -0,0 +1,292 @@\n+### Homework #1\n+\n+(Due Monday 1/12)\n+\n+---\n+\n+**1)** (_Difficulty: mixed_)\n+Predict the output of each of the following expressions, and explain the rules which determine it.\n+If the output depends on the value of x, identify the conditions when the expression will output true.  Assume the cases are independent, and x is reset to an unknown value before each.\n+\n+Some of these are tricky!  Don't trust your first instinct.\n+\n+**a)** `\"1\" == 1`<br />\n+> **true** - string 1 is \"similar enough\" to number 1<br />\n+\n+**b)** `\"1\" === 1`<br />\n+> **false** - string 1 is, strictly speaking, not the same as number 1<br />\n+\n+**c)** `x == 'x'`<br />\n+> **false** - the only way to make this true would be to declare a variable x with a value of the string 'x'<br />\n+> `var x = \"x\"`<br />\n+\n+**d)** `x == (x+'')`<br />\n+> **true** - since adding nothing (empty string `''`) to the variable x won't change its value<br />\n+\n+**e)** `'' == ' '`<br />\n+> **false** - because an empty string is not the same as a string consisting of a space character<br />\n+\n+**f)** `x = true`<br />\n+> **true** - since we just set the value of x equal to true, it is indeed true<br />\n+\n+**g)** `var x; x == 'undefined'`\n+> **false** - while it was not assigned a value, the variable x has been defined, same as assigning value `''`<br />\n+\n+**h)** `'9'<'10'`<br />\n+> **false** - because they are both a `\"string\"`, strings are ordered alphabetically (1 before 9) and therefore, 10 comes before 9<br />\n+\n+**i)** `typeof x + 1 === \"number\"`<br />\n+> **false** - ```typeof x + 1``` returns \"number1\", adding 1 to the result of typeof x<br />\n+\n+**j)** `typeof x % 2 === \"number\"`<br />\n+> **false** - ```typeof x % 2``` returns NaN because it is the same as ```\"number\" % 2```<br />\n+\n+**k)** `typeof (x % 2) === \"number\"` <br />\n+> **true** - makes sense when x is already a number\n+>\n+> ```javascript\n+> var x = 4;\n+> typeof (x % 2); // returns \"number\"\n+> ```\n+> However, I am not clear why this `typeof` returns `\"number\"`\n+>```javascript\n+> var x = \"text\";\n+> (x % 2); // returns NaN, but...\n+> typeof (x % 2); // returns \"number\"\n+>```\n+\n+**l)** `x++ == ++x`\n+> **false** - value of x is returned and then incremented and incremented again before being compared to the new value of x\n+>\n+> ```javascript\n+> var x = 1;\n+> var y = x++; // y = 1, x = 2\n+> var z = ++x; // z = 3, x = 3\n+> y == z; // is false\n+> ```\n+\n+**m)** `++x == x++`\n+> **true** - value of x is incremented and returned, new value of x is compared to x (true), then incremented.\n+>\n+> ```javascript\n+> var x = 1;\n+> var y = ++x; // y = 2, x = 2;\n+> var z = x++; // z = 2, x = 3;\n+> y == z; // is true\n+> ```\n+\n+**n)** `\"1\"+x == 1+x`\n+> **false** - treats addition of strings different from addition of integers\n+>\n+> ```javascript\n+> var x = 4;\n+> \"1\" + x; // returns \"14\"\n+>\n+> var x = 4;\n+> 1 + x; // returns 5\n+>\n+> \"14\" == 5; // returns false\n+> ```\n+\n+**o)** `\"0\"+1 == 1`\n+> **true** - will convert strings to numbers for comparison with non-strict (==) equality\n+> ```javascript\n+> \"0\" + 1; // returns \"01\"\n+>\n+> \"01\" == 1; // returns true\n+> ```\n+\n+**p)** `(typeof (x+1))===(typeof x)`\n+> **true** - comparing `\"numbers\"`\n+> ```javascript\n+> var x = 4;\n+> (typeof (x + 1)); // is same as (5) and returns \"number\"\n+> (typeof x); // is same as 4 and also returns \"number\"\n+> ```\n+\n+**q)** `(x*1 == x) || ((typeof x) != \"number\")`\n+> **true** - since `(x*1 == x)` evaluates to true, second statement is optional (or `||`), it returns true without needing to evaluate the second statement\n+","path":"mtupper/homework.md","position":109,"original_position":109,"commit_id":"7abae3eaa91fe1c113095a56c9905bdc360e4c01","original_commit_id":"7abae3eaa91fe1c113095a56c9905bdc360e4c01","user":{"login":"dsbauer","id":7131061,"avatar_url":"https://avatars.githubusercontent.com/u/7131061?v=3","gravatar_id":"","url":"https://api.github.com/users/dsbauer","html_url":"https://github.com/dsbauer","followers_url":"https://api.github.com/users/dsbauer/followers","following_url":"https://api.github.com/users/dsbauer/following{/other_user}","gists_url":"https://api.github.com/users/dsbauer/gists{/gist_id}","starred_url":"https://api.github.com/users/dsbauer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dsbauer/subscriptions","organizations_url":"https://api.github.com/users/dsbauer/orgs","repos_url":"https://api.github.com/users/dsbauer/repos","events_url":"https://api.github.com/users/dsbauer/events{/privacy}","received_events_url":"https://api.github.com/users/dsbauer/received_events","type":"User","site_admin":false},"body":"Not quite: first clause (x*1 == x) fails for non-numeric strings, undefined, and NaN.  The second clause makes it true for strings and undefined, but NaN still fails both.\r\n","created_at":"2015-01-14T02:16:46Z","updated_at":"2015-01-14T02:16:46Z","html_url":"https://github.com/portlandcodeschool/jse-win15-1/pull/1#discussion_r22912868","pull_request_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/comments/22912868"},"html":{"href":"https://github.com/portlandcodeschool/jse-win15-1/pull/1#discussion_r22912868"},"pull_request":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1","id":27144975,"html_url":"https://github.com/portlandcodeschool/jse-win15-1/pull/1","diff_url":"https://github.com/portlandcodeschool/jse-win15-1/pull/1.diff","patch_url":"https://github.com/portlandcodeschool/jse-win15-1/pull/1.patch","issue_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/1","number":1,"state":"open","locked":false,"title":"mtupper - homework wk 1","user":{"login":"mtupper","id":1226520,"avatar_url":"https://avatars.githubusercontent.com/u/1226520?v=3","gravatar_id":"","url":"https://api.github.com/users/mtupper","html_url":"https://github.com/mtupper","followers_url":"https://api.github.com/users/mtupper/followers","following_url":"https://api.github.com/users/mtupper/following{/other_user}","gists_url":"https://api.github.com/users/mtupper/gists{/gist_id}","starred_url":"https://api.github.com/users/mtupper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtupper/subscriptions","organizations_url":"https://api.github.com/users/mtupper/orgs","repos_url":"https://api.github.com/users/mtupper/repos","events_url":"https://api.github.com/users/mtupper/events{/privacy}","received_events_url":"https://api.github.com/users/mtupper/received_events","type":"User","site_admin":false},"body":"Hi Dan,\r\nI finished the first week's homework.  Please merge.\r\nI did get stuck on **1-K**, will try and remember to ask you for clarification in class or office hours.\r\nMy answers are in `../mtupper/homework.md`\r\n\r\nThanks,\r\nTupper","created_at":"2015-01-10T05:56:08Z","updated_at":"2015-01-14T02:16:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b62a90f58058451132f6fde2a186b39679774862","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1/commits","review_comments_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1/comments","review_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/comments/{number}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/1/comments","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/statuses/7abae3eaa91fe1c113095a56c9905bdc360e4c01","head":{"label":"portlandcodeschool:mtupper","ref":"mtupper","sha":"7abae3eaa91fe1c113095a56c9905bdc360e4c01","user":{"login":"portlandcodeschool","id":3475992,"avatar_url":"https://avatars.githubusercontent.com/u/3475992?v=3","gravatar_id":"","url":"https://api.github.com/users/portlandcodeschool","html_url":"https://github.com/portlandcodeschool","followers_url":"https://api.github.com/users/portlandcodeschool/followers","following_url":"https://api.github.com/users/portlandcodeschool/following{/other_user}","gists_url":"https://api.github.com/users/portlandcodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/portlandcodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portlandcodeschool/subscriptions","organizations_url":"https://api.github.com/users/portlandcodeschool/orgs","repos_url":"https://api.github.com/users/portlandcodeschool/repos","events_url":"https://api.github.com/users/portlandcodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/portlandcodeschool/received_events","type":"Organization","site_admin":false},"repo":{"id":28925885,"name":"jse-win15-1","full_name":"portlandcodeschool/jse-win15-1","owner":{"login":"portlandcodeschool","id":3475992,"avatar_url":"https://avatars.githubusercontent.com/u/3475992?v=3","gravatar_id":"","url":"https://api.github.com/users/portlandcodeschool","html_url":"https://github.com/portlandcodeschool","followers_url":"https://api.github.com/users/portlandcodeschool/followers","following_url":"https://api.github.com/users/portlandcodeschool/following{/other_user}","gists_url":"https://api.github.com/users/portlandcodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/portlandcodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portlandcodeschool/subscriptions","organizations_url":"https://api.github.com/users/portlandcodeschool/orgs","repos_url":"https://api.github.com/users/portlandcodeschool/repos","events_url":"https://api.github.com/users/portlandcodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/portlandcodeschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/portlandcodeschool/jse-win15-1","description":"JS-evening winter 2015 Homework, week 1","fork":false,"url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1","forks_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/forks","keys_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/teams","hooks_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/hooks","issue_events_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/events{/number}","events_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/events","assignees_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/assignees{/user}","branches_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/branches{/branch}","tags_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/tags","blobs_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/statuses/{sha}","languages_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/languages","stargazers_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/stargazers","contributors_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/contributors","subscribers_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/subscribers","subscription_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/subscription","commits_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/comments/{number}","contents_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/contents/{+path}","compare_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/merges","archive_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/downloads","issues_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues{/number}","pulls_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls{/number}","milestones_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/milestones{/number}","notifications_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/labels{/name}","releases_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/releases{/id}","created_at":"2015-01-07T17:42:29Z","updated_at":"2015-01-08T14:09:44Z","pushed_at":"2015-01-14T01:15:07Z","git_url":"git://github.com/portlandcodeschool/jse-win15-1.git","ssh_url":"git@github.com:portlandcodeschool/jse-win15-1.git","clone_url":"https://github.com/portlandcodeschool/jse-win15-1.git","svn_url":"https://github.com/portlandcodeschool/jse-win15-1","homepage":null,"size":345,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":1,"default_branch":"master"}},"base":{"label":"portlandcodeschool:master","ref":"master","sha":"7b4355bb6d2c1e59c9fad0e1f545a0033ba8b46f","user":{"login":"portlandcodeschool","id":3475992,"avatar_url":"https://avatars.githubusercontent.com/u/3475992?v=3","gravatar_id":"","url":"https://api.github.com/users/portlandcodeschool","html_url":"https://github.com/portlandcodeschool","followers_url":"https://api.github.com/users/portlandcodeschool/followers","following_url":"https://api.github.com/users/portlandcodeschool/following{/other_user}","gists_url":"https://api.github.com/users/portlandcodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/portlandcodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portlandcodeschool/subscriptions","organizations_url":"https://api.github.com/users/portlandcodeschool/orgs","repos_url":"https://api.github.com/users/portlandcodeschool/repos","events_url":"https://api.github.com/users/portlandcodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/portlandcodeschool/received_events","type":"Organization","site_admin":false},"repo":{"id":28925885,"name":"jse-win15-1","full_name":"portlandcodeschool/jse-win15-1","owner":{"login":"portlandcodeschool","id":3475992,"avatar_url":"https://avatars.githubusercontent.com/u/3475992?v=3","gravatar_id":"","url":"https://api.github.com/users/portlandcodeschool","html_url":"https://github.com/portlandcodeschool","followers_url":"https://api.github.com/users/portlandcodeschool/followers","following_url":"https://api.github.com/users/portlandcodeschool/following{/other_user}","gists_url":"https://api.github.com/users/portlandcodeschool/gists{/gist_id}","starred_url":"https://api.github.com/users/portlandcodeschool/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portlandcodeschool/subscriptions","organizations_url":"https://api.github.com/users/portlandcodeschool/orgs","repos_url":"https://api.github.com/users/portlandcodeschool/repos","events_url":"https://api.github.com/users/portlandcodeschool/events{/privacy}","received_events_url":"https://api.github.com/users/portlandcodeschool/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/portlandcodeschool/jse-win15-1","description":"JS-evening winter 2015 Homework, week 1","fork":false,"url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1","forks_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/forks","keys_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/teams","hooks_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/hooks","issue_events_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/events{/number}","events_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/events","assignees_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/assignees{/user}","branches_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/branches{/branch}","tags_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/tags","blobs_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/statuses/{sha}","languages_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/languages","stargazers_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/stargazers","contributors_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/contributors","subscribers_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/subscribers","subscription_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/subscription","commits_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/comments/{number}","contents_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/contents/{+path}","compare_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/merges","archive_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/downloads","issues_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues{/number}","pulls_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls{/number}","milestones_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/milestones{/number}","notifications_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/labels{/name}","releases_url":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/releases{/id}","created_at":"2015-01-07T17:42:29Z","updated_at":"2015-01-08T14:09:44Z","pushed_at":"2015-01-14T01:15:07Z","git_url":"git://github.com/portlandcodeschool/jse-win15-1.git","ssh_url":"git@github.com:portlandcodeschool/jse-win15-1.git","clone_url":"https://github.com/portlandcodeschool/jse-win15-1.git","svn_url":"https://github.com/portlandcodeschool/jse-win15-1","homepage":null,"size":345,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1"},"html":{"href":"https://github.com/portlandcodeschool/jse-win15-1/pull/1"},"issue":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/1"},"comments":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/portlandcodeschool/jse-win15-1/statuses/7abae3eaa91fe1c113095a56c9905bdc360e4c01"}}}}