src/expression/transform/map.transform.js
function mapTransform (args, math, scope) {
    let x, callback

    if (args[0]) {
      x = args[0].compile().evaluate(scope)
    }

    if (args[1]) {
      if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {
        // a function pointer, like filter([3, -2, 5], myTestFunction)
        callback = args[1].compile().evaluate(scope)
      } else {
        // an expression like filter([3, -2, 5], x > 0)
        callback = compileInlineExpression(args[1], math, scope)
      }
    }

    return map(x, callback)
  }
function mapTransform (args, math, scope) {
    let x, callback

    if (args[0]) {
      x = args[0].compile().evaluate(scope)
    }

    if (args[1]) {
      if (isSymbolNode(args[1]) || isFunctionAssignmentNode(args[1])) {
        // a function pointer, like filter([3, -2, 5], myTestFunction)
        callback = args[1].compile().evaluate(scope)
      } else {
        // an expression like filter([3, -2, 5], x > 0)
        callback = compileInlineExpression(args[1], math, scope)
      }
    }

    return map(x, callback)
  }
function mapTransform ( args , math , scope ) { let x , callback if ( args [ 0 ] ) { x = args [ 0 ] . compile ( ) . evaluate ( scope ) } if ( args [ 1 ] ) { if ( isSymbolNode ( args [ 1 ] ) || isFunctionAssignmentNode ( args [ 1 ] ) ) { // a function pointer, like filter([3, -2, 5], myTestFunction) callback = args [ 1 ] . compile ( ) . evaluate ( scope ) } else { // an expression like filter([3, -2, 5], x > 0) callback = compileInlineExpression ( args [ 1 ] , math , scope ) } } return map ( x , callback ) }
Attach a transform function to math.map
Adds a property transform containing the transform function.

This transform creates a one-based index instead of a zero-based index
Attach a transform function to math . map Adds a property transform containing the transform function .