{"action":"created","comment":{"url":"https://api.github.com/repos/tjmehta/101/pulls/comments/41713658","id":41713658,"diff_hunk":"@@ -0,0 +1,56 @@\n+/**\n+ * Assert if a given array contains a value\n+ * @module 101/includes\n+ */\n+'use strict';\n+\n+var isNumber = require('./is-number');\n+\n+/**\n+ * @param {Array} array\n+ * @param {*} searchElement\n+ * @param {Number} fromIndex\n+ * @return Boolean\n+ */\n+module.exports = function (array, searchElement, fromIndex) {\n+  if (arguments.length === 1) {\n+    return includes.bind(null, array);\n+  } else {\n+    return includes(array, searchElement, fromIndex);\n+  }\n+};\n+\n+function includes (array, searchElement, fromIndex) {\n+  if (!isNumber(fromIndex)) {\n+    fromIndex = 0;\n+  }\n+  if (Array.prototype.includes) {\n+    return array.includes(searchElement, fromIndex);\n+  } else {\n+    // ES7 Array.prototype.includes polyfill (modified)\n+    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Browser_compatibility\n+    var O = Object(array);\n+    var len = parseInt(O.length) || 0;\n+    if (len === 0) {\n+      return false;\n+    }\n+    var n = fromIndex;\n+    var k;\n+    if (n >= 0) {\n+      k = n;\n+    } else {\n+      k = len + n;\n+      if (k < 0) {k = 0;}\n+    }\n+    var currentElement;\n+    while (k < len) {\n+      currentElement = O[k];\n+      if (searchElement === currentElement ||\n+         (searchElement !== searchElement && currentElement !== currentElement)) {","path":"includes.js","position":49,"original_position":49,"commit_id":"28daa6c577297c9d2282edf1ecce0829e5f934f5","original_commit_id":"28daa6c577297c9d2282edf1ecce0829e5f934f5","user":{"login":"cflynn07","id":467885,"avatar_url":"https://avatars.githubusercontent.com/u/467885?v=3","gravatar_id":"","url":"https://api.github.com/users/cflynn07","html_url":"https://github.com/cflynn07","followers_url":"https://api.github.com/users/cflynn07/followers","following_url":"https://api.github.com/users/cflynn07/following{/other_user}","gists_url":"https://api.github.com/users/cflynn07/gists{/gist_id}","starred_url":"https://api.github.com/users/cflynn07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cflynn07/subscriptions","organizations_url":"https://api.github.com/users/cflynn07/orgs","repos_url":"https://api.github.com/users/cflynn07/repos","events_url":"https://api.github.com/users/cflynn07/events{/privacy}","received_events_url":"https://api.github.com/users/cflynn07/received_events","type":"User","site_admin":false},"body":"Some more information here: https://tc39.github.io/Array.prototype.includes/\r\n`If SameValueZero(searchElement, elementK) is true, return true.`","created_at":"2015-10-11T18:17:13Z","updated_at":"2015-10-11T18:17:13Z","html_url":"https://github.com/tjmehta/101/pull/111#discussion_r41713658","pull_request_url":"https://api.github.com/repos/tjmehta/101/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/tjmehta/101/pulls/comments/41713658"},"html":{"href":"https://github.com/tjmehta/101/pull/111#discussion_r41713658"},"pull_request":{"href":"https://api.github.com/repos/tjmehta/101/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/tjmehta/101/pulls/111","id":47358346,"html_url":"https://github.com/tjmehta/101/pull/111","diff_url":"https://github.com/tjmehta/101/pull/111.diff","patch_url":"https://github.com/tjmehta/101/pull/111.patch","issue_url":"https://api.github.com/repos/tjmehta/101/issues/111","number":111,"state":"open","locked":false,"title":"Add implementation of includes and unit tests","user":{"login":"cflynn07","id":467885,"avatar_url":"https://avatars.githubusercontent.com/u/467885?v=3","gravatar_id":"","url":"https://api.github.com/users/cflynn07","html_url":"https://github.com/cflynn07","followers_url":"https://api.github.com/users/cflynn07/followers","following_url":"https://api.github.com/users/cflynn07/following{/other_user}","gists_url":"https://api.github.com/users/cflynn07/gists{/gist_id}","starred_url":"https://api.github.com/users/cflynn07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cflynn07/subscriptions","organizations_url":"https://api.github.com/users/cflynn07/orgs","repos_url":"https://api.github.com/users/cflynn07/repos","events_url":"https://api.github.com/users/cflynn07/events{/privacy}","received_events_url":"https://api.github.com/users/cflynn07/received_events","type":"User","site_admin":false},"body":"Implementation for https://github.com/tjmehta/101/issues/109\r\n\r\nWent a little further than the functionality in the proposed example of 109 and added an optional \"fromIndex\" argument to limit search space of array (functionality as defined in ES7 proposal).\r\n","created_at":"2015-10-11T02:07:49Z","updated_at":"2015-10-11T18:17:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f538f7cbc00a9928cf63ee16c4a16aa1494faca","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tjmehta/101/pulls/111/commits","review_comments_url":"https://api.github.com/repos/tjmehta/101/pulls/111/comments","review_comment_url":"https://api.github.com/repos/tjmehta/101/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tjmehta/101/issues/111/comments","statuses_url":"https://api.github.com/repos/tjmehta/101/statuses/28daa6c577297c9d2282edf1ecce0829e5f934f5","head":{"label":"cflynn07:109-add-includes","ref":"109-add-includes","sha":"28daa6c577297c9d2282edf1ecce0829e5f934f5","user":{"login":"cflynn07","id":467885,"avatar_url":"https://avatars.githubusercontent.com/u/467885?v=3","gravatar_id":"","url":"https://api.github.com/users/cflynn07","html_url":"https://github.com/cflynn07","followers_url":"https://api.github.com/users/cflynn07/followers","following_url":"https://api.github.com/users/cflynn07/following{/other_user}","gists_url":"https://api.github.com/users/cflynn07/gists{/gist_id}","starred_url":"https://api.github.com/users/cflynn07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cflynn07/subscriptions","organizations_url":"https://api.github.com/users/cflynn07/orgs","repos_url":"https://api.github.com/users/cflynn07/repos","events_url":"https://api.github.com/users/cflynn07/events{/privacy}","received_events_url":"https://api.github.com/users/cflynn07/received_events","type":"User","site_admin":false},"repo":{"id":22444456,"name":"101","full_name":"cflynn07/101","owner":{"login":"cflynn07","id":467885,"avatar_url":"https://avatars.githubusercontent.com/u/467885?v=3","gravatar_id":"","url":"https://api.github.com/users/cflynn07","html_url":"https://github.com/cflynn07","followers_url":"https://api.github.com/users/cflynn07/followers","following_url":"https://api.github.com/users/cflynn07/following{/other_user}","gists_url":"https://api.github.com/users/cflynn07/gists{/gist_id}","starred_url":"https://api.github.com/users/cflynn07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cflynn07/subscriptions","organizations_url":"https://api.github.com/users/cflynn07/orgs","repos_url":"https://api.github.com/users/cflynn07/repos","events_url":"https://api.github.com/users/cflynn07/events{/privacy}","received_events_url":"https://api.github.com/users/cflynn07/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cflynn07/101","description":"common utils / helpers that can be required selectively","fork":true,"url":"https://api.github.com/repos/cflynn07/101","forks_url":"https://api.github.com/repos/cflynn07/101/forks","keys_url":"https://api.github.com/repos/cflynn07/101/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cflynn07/101/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cflynn07/101/teams","hooks_url":"https://api.github.com/repos/cflynn07/101/hooks","issue_events_url":"https://api.github.com/repos/cflynn07/101/issues/events{/number}","events_url":"https://api.github.com/repos/cflynn07/101/events","assignees_url":"https://api.github.com/repos/cflynn07/101/assignees{/user}","branches_url":"https://api.github.com/repos/cflynn07/101/branches{/branch}","tags_url":"https://api.github.com/repos/cflynn07/101/tags","blobs_url":"https://api.github.com/repos/cflynn07/101/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cflynn07/101/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cflynn07/101/git/refs{/sha}","trees_url":"https://api.github.com/repos/cflynn07/101/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cflynn07/101/statuses/{sha}","languages_url":"https://api.github.com/repos/cflynn07/101/languages","stargazers_url":"https://api.github.com/repos/cflynn07/101/stargazers","contributors_url":"https://api.github.com/repos/cflynn07/101/contributors","subscribers_url":"https://api.github.com/repos/cflynn07/101/subscribers","subscription_url":"https://api.github.com/repos/cflynn07/101/subscription","commits_url":"https://api.github.com/repos/cflynn07/101/commits{/sha}","git_commits_url":"https://api.github.com/repos/cflynn07/101/git/commits{/sha}","comments_url":"https://api.github.com/repos/cflynn07/101/comments{/number}","issue_comment_url":"https://api.github.com/repos/cflynn07/101/issues/comments{/number}","contents_url":"https://api.github.com/repos/cflynn07/101/contents/{+path}","compare_url":"https://api.github.com/repos/cflynn07/101/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cflynn07/101/merges","archive_url":"https://api.github.com/repos/cflynn07/101/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cflynn07/101/downloads","issues_url":"https://api.github.com/repos/cflynn07/101/issues{/number}","pulls_url":"https://api.github.com/repos/cflynn07/101/pulls{/number}","milestones_url":"https://api.github.com/repos/cflynn07/101/milestones{/number}","notifications_url":"https://api.github.com/repos/cflynn07/101/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cflynn07/101/labels{/name}","releases_url":"https://api.github.com/repos/cflynn07/101/releases{/id}","created_at":"2014-07-30T20:59:02Z","updated_at":"2015-03-31T21:46:42Z","pushed_at":"2015-10-11T02:06:06Z","git_url":"git://github.com/cflynn07/101.git","ssh_url":"git@github.com:cflynn07/101.git","clone_url":"https://github.com/cflynn07/101.git","svn_url":"https://github.com/cflynn07/101","homepage":null,"size":569,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"tjmehta:master","ref":"master","sha":"e7ebf36e2d4780efd1cf0db854ea716c8d446099","user":{"login":"tjmehta","id":640279,"avatar_url":"https://avatars.githubusercontent.com/u/640279?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmehta","html_url":"https://github.com/tjmehta","followers_url":"https://api.github.com/users/tjmehta/followers","following_url":"https://api.github.com/users/tjmehta/following{/other_user}","gists_url":"https://api.github.com/users/tjmehta/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmehta/subscriptions","organizations_url":"https://api.github.com/users/tjmehta/orgs","repos_url":"https://api.github.com/users/tjmehta/repos","events_url":"https://api.github.com/users/tjmehta/events{/privacy}","received_events_url":"https://api.github.com/users/tjmehta/received_events","type":"User","site_admin":false},"repo":{"id":18667134,"name":"101","full_name":"tjmehta/101","owner":{"login":"tjmehta","id":640279,"avatar_url":"https://avatars.githubusercontent.com/u/640279?v=3","gravatar_id":"","url":"https://api.github.com/users/tjmehta","html_url":"https://github.com/tjmehta","followers_url":"https://api.github.com/users/tjmehta/followers","following_url":"https://api.github.com/users/tjmehta/following{/other_user}","gists_url":"https://api.github.com/users/tjmehta/gists{/gist_id}","starred_url":"https://api.github.com/users/tjmehta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjmehta/subscriptions","organizations_url":"https://api.github.com/users/tjmehta/orgs","repos_url":"https://api.github.com/users/tjmehta/repos","events_url":"https://api.github.com/users/tjmehta/events{/privacy}","received_events_url":"https://api.github.com/users/tjmehta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjmehta/101","description":"A modern JS utility library","fork":false,"url":"https://api.github.com/repos/tjmehta/101","forks_url":"https://api.github.com/repos/tjmehta/101/forks","keys_url":"https://api.github.com/repos/tjmehta/101/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjmehta/101/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjmehta/101/teams","hooks_url":"https://api.github.com/repos/tjmehta/101/hooks","issue_events_url":"https://api.github.com/repos/tjmehta/101/issues/events{/number}","events_url":"https://api.github.com/repos/tjmehta/101/events","assignees_url":"https://api.github.com/repos/tjmehta/101/assignees{/user}","branches_url":"https://api.github.com/repos/tjmehta/101/branches{/branch}","tags_url":"https://api.github.com/repos/tjmehta/101/tags","blobs_url":"https://api.github.com/repos/tjmehta/101/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjmehta/101/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjmehta/101/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjmehta/101/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjmehta/101/statuses/{sha}","languages_url":"https://api.github.com/repos/tjmehta/101/languages","stargazers_url":"https://api.github.com/repos/tjmehta/101/stargazers","contributors_url":"https://api.github.com/repos/tjmehta/101/contributors","subscribers_url":"https://api.github.com/repos/tjmehta/101/subscribers","subscription_url":"https://api.github.com/repos/tjmehta/101/subscription","commits_url":"https://api.github.com/repos/tjmehta/101/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjmehta/101/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjmehta/101/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjmehta/101/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjmehta/101/contents/{+path}","compare_url":"https://api.github.com/repos/tjmehta/101/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjmehta/101/merges","archive_url":"https://api.github.com/repos/tjmehta/101/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjmehta/101/downloads","issues_url":"https://api.github.com/repos/tjmehta/101/issues{/number}","pulls_url":"https://api.github.com/repos/tjmehta/101/pulls{/number}","milestones_url":"https://api.github.com/repos/tjmehta/101/milestones{/number}","notifications_url":"https://api.github.com/repos/tjmehta/101/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjmehta/101/labels{/name}","releases_url":"https://api.github.com/repos/tjmehta/101/releases{/id}","created_at":"2014-04-11T08:14:09Z","updated_at":"2015-10-09T07:53:25Z","pushed_at":"2015-10-11T02:07:50Z","git_url":"git://github.com/tjmehta/101.git","ssh_url":"git@github.com:tjmehta/101.git","clone_url":"https://github.com/tjmehta/101.git","svn_url":"https://github.com/tjmehta/101","homepage":"","size":1360,"stargazers_count":1430,"watchers_count":1430,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":62,"mirror_url":null,"open_issues_count":12,"forks":62,"open_issues":12,"watchers":1430,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tjmehta/101/pulls/111"},"html":{"href":"https://github.com/tjmehta/101/pull/111"},"issue":{"href":"https://api.github.com/repos/tjmehta/101/issues/111"},"comments":{"href":"https://api.github.com/repos/tjmehta/101/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/tjmehta/101/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/tjmehta/101/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tjmehta/101/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/tjmehta/101/statuses/28daa6c577297c9d2282edf1ecce0829e5f934f5"}}}}