MCPcopy Create free account
hub / github.com/melonjs/melonJS / remove

Function remove

packages/melonjs/src/utils/array.ts:19–25  ·  view source on GitHub ↗
(arr: T[], obj: T)

Source from the content-addressed store, hash-verified

17 * me.utils.array.remove(arr, "foo");
18 */
19export function remove<T>(arr: T[], obj: T): T[] {
20 const i = Array.prototype.indexOf.call(arr, obj);
21 if (i !== -1) {
22 Array.prototype.splice.call(arr, i, 1);
23 }
24 return arr;
25}
26
27/**
28 * return a random array element

Callers 2

removeShapeMethod · 0.90
releasePointerEventFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected