{"action":"created","comment":{"url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/comments/35372228","id":35372228,"diff_hunk":"@@ -0,0 +1,166 @@\n+### Chad Miller\n+### Answers are all inline, either after or below the question, beginning with //\n+\n+### Homework #1\n+(Due Monday 7/20)\n+\n+You need to turn in this homework by cloning this repo, making a new branch with your solutions, pushing to github, and issuing a pull request.\n+For details, follow the instructions [here](http://portlandcodeschool.github.io/jse/2015/01/07/command-line-and-git-slides/#/14).\n+\n+Please also read the [learning objectives](objectives.md) for this week.\n+\n+---\n+\n+**1)** (_30% of total time_)\n+Predict the output of each of the following expressions, and explain the rules which determine that answer.  (_Hint: The rules for operator `==` are complicated, but do your best!_)\n+\n+If the output depends on the value or type of variable _x_, identify the conditions (what _x_ is) when the expression will output true (or false, if that's simpler).  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+\n+**a)** `\"1\" == 1` //true / js will change types when using ==\n+\n+**b)** `\"1\" === 1` //false / js will NOT change types when using ===\n+\n+**c)** `x == 'x'` //false / unless x has been set to 'x'\n+\n+**d)** `x == (x+'')` //true / == ignores the added string\n+\n+**e)** `'' == ' '` //false / an empty string is not equal to a string with a space in it\n+\n+**f)** `x = true` //true / sets x to true\n+\n+**g)** `var x; x == 'undefined'` //false / x == undefined, not the string 'undefined'\n+\n+**h)** `'9'<'10'` //false / alphabetically 1 is \"less\" than 9\n+\n+**i)** `typeof x + 1 === \"number\"` //false / typeof is unary so operates on the first thing it sees to it's right. in this case typeof x is \"number\", but then a 1 gets concatenated on the end so it's not === to \"number\"\n+\n+**j)** `typeof x % 2 === \"number\"` //false / in this case typeof x starts out as \"number\" but then the % 2 adds uncertainty so js says NaN???\n+\n+**k)** `typeof (x % 2) === \"number\"` //true / this time js operates in the () first and, assuming x was a number, will spit out a number to the typeof, resulting in  \"number\"\n+\n+**l)** `x++ == ++x` //false / pre-incrementing is happening on the right side of the expression, so they can never be equal. ex. x=3; x++(outputs 3 and sets x to 4) == ++x(sets x to 5 and outputs 5) will be false.\n+\n+**m)** `++x == x++` //true / pre-incrementing happens on the left only so... x=3; ++X(sets x to 4 and outputs 4) == x++(outputs 4 and then sets x to 5) both sides output 4 so the expression is true\n+\n+**n)** `\"1\"+x == 1+x` //false / \"1\"+x concatenates 1 and the value of x while 1+x adds 1 to the value of x\n+\n+**o)** `\"0\"+1 == 1` //true/ js will compare the string \"01\" with 1 and find it to be truthy\n+\n+**p)** `(typeof (x+1))===(typeof x)` //true / assuming x is a number, the left side will operate like **k)** above, and both sides will spit out \"number\"\n+\n+**q)** `(x*1 == x) || ((typeof x) != \"number\")` //true / the left side of the || returns a \"boolean\" which does not equal \"number\"\n+\n+**r)** `(x=(typeof (x+(typeof x))))==x`//true / the left side sets x = to \"string\" and then compares it to x on the right side which is now \"string\" thanks to the left side??\n+","path":"chad/README.md","position":57,"original_position":57,"commit_id":"50293292c4cf56da4b249063cb6268370f0ef689","original_commit_id":"50293292c4cf56da4b249063cb6268370f0ef689","user":{"login":"ergray","id":9043755,"avatar_url":"https://avatars.githubusercontent.com/u/9043755?v=3","gravatar_id":"","url":"https://api.github.com/users/ergray","html_url":"https://github.com/ergray","followers_url":"https://api.github.com/users/ergray/followers","following_url":"https://api.github.com/users/ergray/following{/other_user}","gists_url":"https://api.github.com/users/ergray/gists{/gist_id}","starred_url":"https://api.github.com/users/ergray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ergray/subscriptions","organizations_url":"https://api.github.com/users/ergray/orgs","repos_url":"https://api.github.com/users/ergray/repos","events_url":"https://api.github.com/users/ergray/events{/privacy}","received_events_url":"https://api.github.com/users/ergray/received_events","type":"User","site_admin":false},"body":"More specifically, all the interior work here is set to x, and then is just compared against itself. So the right side isn't now anything, it's just what it always has been, which is x.","created_at":"2015-07-23T21:13:42Z","updated_at":"2015-07-23T21:13:42Z","html_url":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12#discussion_r35372228","pull_request_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/comments/35372228"},"html":{"href":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12#discussion_r35372228"},"pull_request":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12","id":40413268,"html_url":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12","diff_url":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12.diff","patch_url":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12.patch","issue_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/12","number":12,"state":"open","locked":false,"title":"Chad's answers to homework #1","user":{"login":"wick42","id":12244375,"avatar_url":"https://avatars.githubusercontent.com/u/12244375?v=3","gravatar_id":"","url":"https://api.github.com/users/wick42","html_url":"https://github.com/wick42","followers_url":"https://api.github.com/users/wick42/followers","following_url":"https://api.github.com/users/wick42/following{/other_user}","gists_url":"https://api.github.com/users/wick42/gists{/gist_id}","starred_url":"https://api.github.com/users/wick42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wick42/subscriptions","organizations_url":"https://api.github.com/users/wick42/orgs","repos_url":"https://api.github.com/users/wick42/repos","events_url":"https://api.github.com/users/wick42/events{/privacy}","received_events_url":"https://api.github.com/users/wick42/received_events","type":"User","site_admin":false},"body":"Answers are inline after the questions\r\n","created_at":"2015-07-21T00:56:58Z","updated_at":"2015-07-23T21:13:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6be8ad4da3734ee05a1534a7c5620822f8c6fdd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12/commits","review_comments_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12/comments","review_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/12/comments","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/statuses/50293292c4cf56da4b249063cb6268370f0ef689","head":{"label":"portlandcodeschool:chad","ref":"chad","sha":"50293292c4cf56da4b249063cb6268370f0ef689","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":38991768,"name":"jse-fall15-1","full_name":"portlandcodeschool/jse-fall15-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-fall15-1","description":"Javascript evening course (fall 2015) homework, week 1","fork":false,"url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1","forks_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/forks","keys_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/teams","hooks_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/hooks","issue_events_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/events{/number}","events_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/events","assignees_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/assignees{/user}","branches_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/branches{/branch}","tags_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/tags","blobs_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/statuses/{sha}","languages_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/languages","stargazers_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/stargazers","contributors_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/contributors","subscribers_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/subscribers","subscription_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/subscription","commits_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/contents/{+path}","compare_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/merges","archive_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/downloads","issues_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues{/number}","pulls_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls{/number}","milestones_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/milestones{/number}","notifications_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/labels{/name}","releases_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/releases{/id}","created_at":"2015-07-13T04:50:53Z","updated_at":"2015-07-19T04:36:51Z","pushed_at":"2015-07-23T13:19:16Z","git_url":"git://github.com/portlandcodeschool/jse-fall15-1.git","ssh_url":"git@github.com:portlandcodeschool/jse-fall15-1.git","clone_url":"https://github.com/portlandcodeschool/jse-fall15-1.git","svn_url":"https://github.com/portlandcodeschool/jse-fall15-1","homepage":null,"size":2452,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":2,"default_branch":"master"}},"base":{"label":"portlandcodeschool:master","ref":"master","sha":"31d35b1de7c195d2b90085b6d5b42aa9249814d6","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":38991768,"name":"jse-fall15-1","full_name":"portlandcodeschool/jse-fall15-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-fall15-1","description":"Javascript evening course (fall 2015) homework, week 1","fork":false,"url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1","forks_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/forks","keys_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/teams","hooks_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/hooks","issue_events_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/events{/number}","events_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/events","assignees_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/assignees{/user}","branches_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/branches{/branch}","tags_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/tags","blobs_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/statuses/{sha}","languages_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/languages","stargazers_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/stargazers","contributors_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/contributors","subscribers_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/subscribers","subscription_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/subscription","commits_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/contents/{+path}","compare_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/merges","archive_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/downloads","issues_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues{/number}","pulls_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls{/number}","milestones_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/milestones{/number}","notifications_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/labels{/name}","releases_url":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/releases{/id}","created_at":"2015-07-13T04:50:53Z","updated_at":"2015-07-19T04:36:51Z","pushed_at":"2015-07-23T13:19:16Z","git_url":"git://github.com/portlandcodeschool/jse-fall15-1.git","ssh_url":"git@github.com:portlandcodeschool/jse-fall15-1.git","clone_url":"https://github.com/portlandcodeschool/jse-fall15-1.git","svn_url":"https://github.com/portlandcodeschool/jse-fall15-1","homepage":null,"size":2452,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":14,"forks":0,"open_issues":14,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12"},"html":{"href":"https://github.com/portlandcodeschool/jse-fall15-1/pull/12"},"issue":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/12"},"comments":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/portlandcodeschool/jse-fall15-1/statuses/50293292c4cf56da4b249063cb6268370f0ef689"}}}}