lib/util/ast-utils.js
function isInLoop(node) {
    for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) {
        if (isLoop(currentNode)) {
            return true;
        }
    }

    return false;
}
function isInLoop(node) {
    for (let currentNode = node; currentNode && !isFunction(currentNode); currentNode = currentNode.parent) {
        if (isLoop(currentNode)) {
            return true;
        }
    }

    return false;
}
function isInLoop ( node ) { for ( let currentNode = node ; currentNode && ! isFunction ( currentNode ) ; currentNode = currentNode . parent ) { if ( isLoop ( currentNode ) ) { return true ; } } return false ; }
Checks whether the given node is in a loop or not.

@param {ASTNode} node - The node to check.
@returns {boolean} `true` if the node is in a loop.
Checks whether the given node is in a loop or not .