MCPcopy
hub / github.com/josdejong/mathjs / map

Method map

src/expression/node/RangeNode.js:136–142  ·  view source on GitHub ↗

* Create a new RangeNode whose children are the results of calling * the provided callback function for each child of the original node. * @param {function(child: Node, path: string, parent: Node): Node} callback * @returns {RangeNode} Returns a transformed copy of the node

(callback)

Source from the content-addressed store, hash-verified

134 * @returns {RangeNode} Returns a transformed copy of the node
135 */
136 map (callback) {
137 return new RangeNode(
138 this._ifNode(callback(this.start, 'start', this)),
139 this._ifNode(callback(this.end, 'end', this)),
140 this.step && this._ifNode(callback(this.step, 'step', this))
141 )
142 }
143
144 /**
145 * Create a clone of this node, a shallow copy

Callers

nothing calls this directly

Calls 2

_ifNodeMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected