Skip to content

removePath$

Subhajit Sahu edited this page Jun 28, 2020 · 9 revisions

Gets value at index. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]

Alternatives: [remove], [remove$], [removePath$].
Similar: [hasPath], [getPath], [setPath$], [removePath$].
Similar: [get], [set], [remove].

array.get(x, i);
// x: an array
// i: index (-ve: from right)
const array = require('extra-array');

var x = [[2, 4], 6, 8];
array.removePath$(x, [1], 60);
// [ [ 2, 4 ], 8 ]

x;
// [ [ 2, 4 ], 8 ]

array.removePath$(x, [0, 1], 40);
// [ [ 2 ], 8 ]

array.removePath$(x, [0, 1, 2], 100);
// [ [ 2 ], 8 ] (path not present, no effect)

references

Clone this wiki locally