{"id":26883971,"url":"https://github.com/ferreiratiago/es7","last_synced_at":"2025-03-31T17:38:00.863Z","repository":{"id":196979892,"uuid":"86841745","full_name":"ferreiratiago/es7","owner":"ferreiratiago","description":"Playground for ECMAScript 2016 (ES7)","archived":false,"fork":false,"pushed_at":"2017-04-06T07:39:13.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-09-28T13:57:19.728Z","etag":null,"topics":["ecmascript","ecmascript2016","es7","es7-array-prototype-includes","es7-exponentiation-operator"],"latest_commit_sha":null,"homepage":"https://github.com/tc39/proposals/blob/master/finished-proposals.md","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferreiratiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-31T16:56:54.000Z","updated_at":"2023-09-28T13:57:50.241Z","dependencies_parsed_at":null,"dependency_job_id":"f29c907b-2b2b-4a74-9f25-bb2ff481aed8","html_url":"https://github.com/ferreiratiago/es7","commit_stats":null,"previous_names":["ferreiratiago/es7"],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreiratiago%2Fes7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreiratiago%2Fes7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreiratiago%2Fes7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreiratiago%2Fes7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferreiratiago","download_url":"https://codeload.github.com/ferreiratiago/es7/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246510065,"owners_count":20789283,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecmascript","ecmascript2016","es7","es7-array-prototype-includes","es7-exponentiation-operator"],"created_at":"2025-03-31T17:38:00.093Z","updated_at":"2025-03-31T17:38:00.857Z","avatar_url":"https://github.com/ferreiratiago.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ES7 (ECMAScript 2016)\n* [Array.prototype.includes](#arrayprototypeincludes)\n* [Exponentiation Operator](#exponentiation-operator)\n\n## Array.prototype.includes\n\nArray `.includes()` determines if an array includes an specified element, returning `true` if it includes, `false` otherwise.\n\n### Syntax\n\n```\nincludes :: (searchElement, ?fromIndex) -\u003e Boolean\n```\n\n### Parameters\n* `searchElement` - the element to search on the array.\n* `fromIndex` - the index from which the search starts.\n\n### Examples\n\n`includes :: (searchElement) -\u003e Boolean`\n\n```js\n[].includes()                   // false\n[].includes(undefined)          // false\n['foo',3,{}].includes({})       // false\n['foo','bar'].includes('zed')   // false\n\n[-0].includes(+0)               // true\n[1,2,3].includes(2)             // true\n['foo','bar'].includes('foo')   // true\n[undefined].includes(undefined) // true\n```\n\n`includes :: (searchElement, fromIndex \u003e= 0) -\u003e Boolean`\n\n```js\n['foo','bar','zed'].includes('foo')    // true - fromIndex 0 by default\n['foo','bar','zed'].includes('foo',1)  // false\n['foo','bar','zed'].includes('bar',1)  // true\n// If the fromIndex is greater or equal to the array size,\n// the array is not searched and false is returned.\n['foo','bar','zed'].includes('bar',10) // false\n```\n\n`includes :: (searchElement, fromIndex \u003c 0) -\u003e Boolean`\n\n```js\n// When fromIndex is negative a computed index is calculated to be used.\n// If the computed index if less than 0, the entire array is search.\n// The computation goes like this:\n// Computed index = Array length + fromIndex\n// e.g.\nvar array = ['a','b','c','d'] // length = 4\narray.includes('b', -3)  // computed index = 4 + (-3) = 1,   result = true\narray.includes('b', -1)  // computed index = 4 + (-1) = 3,   result = false\narray.includes('b', -10) // computed index = 4 + (-10) = -6, result = false\n```\n\n### Further Reading\n[Array.prototype.includes](https://github.com/tc39/Array.prototype.includes/) (Domenic Denicola, Rick Waldron)\n\n## Exponentiation Operator\n\nExponentiation operator returns the result of raising the first operand to the power of the second (e.g. `x ** y`).\nIt will return the same result as `Math.pow(x,y)`.\n\n### Syntax\n\n```\nx ** y\n```\n\n### Example\n\n```js\n// x ** y (aka Math.pow(x,y))\n2 ** 2   // 4\n2 ** 'a' // NaN\n\nvar e = 2\ne **= 2  // 4\n```\n\n### Further Reading\n[Exponentiation Operator](https://github.com/rwaldron/exponentiation-operator) (Rick Waldron)\n\n## Thanks to :beers:\n* [2ality.com](http://2ality.com/2016/01/ecmascript-2016.html) by [Axel Rauschmayer](https://twitter.com/rauschma)\n* MDN documentation\n    * [Array.prototype.includes](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)\n    * [Exponentiation Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferreiratiago%2Fes7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferreiratiago%2Fes7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferreiratiago%2Fes7/lists"}