code: function isCallbackOfArrayMethod (node) {
    while (node) {
      var parent = node.parent
  
      switch (parent.type) {
        case 'LogicalExpression':
        case 'ConditionalExpression':
          node = parent
          break
  
        case 'ReturnStatement':
          var func = astUtils.getUpperFunction(parent)
  
          if (func === null || !astUtils.isCallee(func)) {
            return false
          }
          node = func.parent
          break
  
        case 'CallExpression':
          if (isTargetMethod(parent.callee)) {
            return (parent.arguments.length >= 1 && parent.arguments[0] === node)
          }
          return false
  
        // Otherwise this node is not target.
        /* istanbul ignore next: unreachable */
        default:
          return false
      }
    }
  
    /* istanbul ignore next: unreachable */
    return false
  }
docs: Checks whether or not a given node is a function expression which is the
  callback of an array method.
  
  @param {ASTNode} node - A node to check. This is one of
  FunctionExpression or ArrowFunctionExpression.
  @returns {boolean} `true` if the node is the callback of an array method.