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

Method map

src/expression/node/FunctionAssignmentNode.js:143–147  ·  view source on GitHub ↗

* Create a new FunctionAssignmentNode 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 {FunctionAssignmentNode} Returns a transf

(callback)

Source from the content-addressed store, hash-verified

141 * @returns {FunctionAssignmentNode} Returns a transformed copy of the node
142 */
143 map (callback) {
144 const expr = this._ifNode(callback(this.expr, 'expr', this))
145
146 return new FunctionAssignmentNode(this.name, this.params.slice(0), expr)
147 }
148
149 /**
150 * 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