MCPcopy Create free account
hub / github.com/btholt/algorithms-exercises / delete

Method delete

specs/arrays/arraylist.solution.test.js:38–42  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

36 return this.data[index];
37 }
38 delete(index) {
39 const ans = this.data[index];
40 this._collapseTo(index);
41 return ans;
42 }
43 _collapseTo(index) {
44 for (let i = index; i < this.length; i++) {
45 this.data[i] = this.data[i + 1];

Callers 1

Calls 1

_collapseToMethod · 0.95

Tested by

no test coverage detected