{"id":19648112,"url":"https://github.com/olaferlandsen/array.prototype","last_synced_at":"2026-06-18T09:31:31.912Z","repository":{"id":150716417,"uuid":"84266415","full_name":"olaferlandsen/array.prototype","owner":"olaferlandsen","description":"Array prototype utils","archived":false,"fork":false,"pushed_at":"2017-03-08T13:41:05.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-27T00:42:19.820Z","etag":null,"topics":["array","array-prototype","arrays","prototype","remove","shuffle","sum","utils"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olaferlandsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-08T01:56:29.000Z","updated_at":"2017-03-08T03:43:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"b40f6b13-0084-4278-a311-003ca2d8675e","html_url":"https://github.com/olaferlandsen/array.prototype","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olaferlandsen/array.prototype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaferlandsen%2Farray.prototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaferlandsen%2Farray.prototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaferlandsen%2Farray.prototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaferlandsen%2Farray.prototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olaferlandsen","download_url":"https://codeload.github.com/olaferlandsen/array.prototype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olaferlandsen%2Farray.prototype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34485163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["array","array-prototype","arrays","prototype","remove","shuffle","sum","utils"],"created_at":"2024-11-11T14:47:11.069Z","updated_at":"2026-06-18T09:31:31.743Z","avatar_url":"https://github.com/olaferlandsen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API:\n* [column](#column)\n* [empty](#empty)\n* [last](#last)\n* [exists](#exists)\n* [exists](#exists)\n* [get](#get)\n* [isEmpty](#isEmpty)\n* [left](#isEmpty)\n* [move](#isEmpty)\n* [remove](#remove)\n* [right](#right)\n* [shuffle](#shuffle)\n* [start](#start)\n* [sum](#sum)\n* [down](#down)\n* [first](#first)\n* [last](#last)\n* [up](#up) - Alias of [left](#left)\n\n### `array` Array.prototype.column (`index`)\nReturn the values from a single column\n\n```javascript\n[\n    [1,2,3,4,5],\n    [6,7,8,9,0],\n    [1,3,4,6,9]\n].column(0) // returns [1,6,1]\n```\n### `boolean` Array.prototype.empty ()\nTruncate Array\n\n```javascript\nvar a = [1,2,3,4,5,6,7,8,9,0];\na.empty();\nconsole.log(a); // returns []\n```\n\n### `*` Array.prototype.end ()\n\u003e **IMPORTANT:** Alias of [last](#last)\n\nGet the last item\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].end() // returns 0\n```\n\n### `boolean` Array.prototype.exists (`index`)\nCheck if item exists by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].exists(0)  // returns true\n[1,2,3,4,5,6,7,8,9,0].exists(-1) // returns false\n[1,2,3,4,5,6,7,8,9,0].exists(10) // returns false\n[1,2,3,4,5,6,7,8,9,0].exists(9)  // returns true\n```\n### `*` Array.prototype.get(`index`, `_default`)\nGet a item by index. If it not exists, return you own default value\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].get(0) // returns 1\n[1,2,3,4,5,6,7,8,9,0].get(-1, false) // returns false\n[1,2,3,4,5,6,7,8,9,0].get(-1) // returns undefined\n```\n\n### `boolean` Array.prototype.isEmpty ()\nCheck if a empty Array\n\n```javascript\nvar a = [];\nvar b = [1,2,3,4,5,6,7,8,9,0];\na.isEmpty() // returns true\nb.isEmpty() // returns false\n```\n\n### `boolean` Array.prototype.left (`index`)\nMove item to left position by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].left(0); // returns [1,2,3,4,5,6,7,8,9,0]\n[1,2,3,4,5,6,7,8,9,0].left(9); // returns [1,2,3,4,5,6,7,9,8,0]\n```\n\n### `boolean` Array.prototype.move (`from`, `to`)\nMove a item by index position to a new index position\n\n```javascript\n[0,1,2,3,4,5,6,7,8,9].move(0, 9); // returns [1,2,3,4,5,6,7,8,9,0]\n```\n### `boolean` Array.prototype.remove (`index`)\nRemove a item by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].remove(0); // returns true\n// produces\n// [2,3,4,5,6,7,8,9,0]\n```\n\n### `boolean` Array.prototype.right (`index`)\nMove item to right position by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].right(0); // returns [1,2,3,4,5,6,7,8,9,0]\n[1,2,3,4,5,6,7,8,9,0].right(9); // returns [1,2,3,4,5,6,7,9,8,0]\n```\n\n### `array` Array.prototype.shuffle ()\nShuffle array\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].shuffle();\n```\n\n### `*` Array.prototype.start ()\n\u003e **IMPORTANT:** Alias of [first](#first)\n\nGet the first item\n\n```javascript\n[1,2,3,4,5].start() // returns 1\n```\n\n### `number` Array.prototype.sum ()\nCalculate the sum of values\n\n```javascript\n[1,2,3,4].sum() // returns 10\n```\n\n### `boolean` Array.prototype.down (`index`)\n\u003e **IMPORTANT:** Alias of [right](#right)\n\nMove item to right position by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].down(0); // returns [1,2,3,4,5,6,7,8,9,0]\n[1,2,3,4,5,6,7,8,9,0].down(9); // returns [1,2,3,4,5,6,7,9,8,0]\n```\n\n### `*` Array.prototype.first ()\nGet the first item\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].first() // returns 1\n```\n\n### `*` Array.prototype.last ()\nGet the last item\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].last() // returns 0\n```\n\n### `boolean` Array.prototype.up (`index`)\n\u003e **IMPORTANT:** Alias of [left](#left)\n\nMove item to up position by index\n\n```javascript\n[1,2,3,4,5,6,7,8,9,0].up(0); // returns [1,2,3,4,5,6,7,8,9,0]\n[1,2,3,4,5,6,7,8,9,0].up(9); // returns [1,2,3,4,5,6,7,9,8,0]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folaferlandsen%2Farray.prototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folaferlandsen%2Farray.prototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folaferlandsen%2Farray.prototype/lists"}