Skip to content

removePath$

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

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

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

object.get(x, k);
// x: an object
// k: key
const object = require('extra-object');

var x = {a: {b: 2, c: 3}, d: 4};
object.removePath$(x, ['d'], 40);
// { a: { b: 2, c: 3 } }

x;
// { a: { b: 2, c: 3 } }

object.removePath$(x, ['a', 'b'], 20);
// { a: { c: 3 } }

object.removePath$(x, ['a', 'b', 'c'], 30);
// { a: { c: 3 } }

references

Clone this wiki locally