lib/rules/one-var.js
function countDeclarations(declarations) {
            const counts = { uninitialized: 0, initialized: 0 };

            for (let i = 0; i < declarations.length; i++) {
                if (declarations[i].init === null) {
                    counts.uninitialized++;
                } else {
                    counts.initialized++;
                }
            }
            return counts;
        }
function countDeclarations(declarations) {
            const counts = { uninitialized: 0, initialized: 0 };

            for (let i = 0; i < declarations.length; i++) {
                if (declarations[i].init === null) {
                    counts.uninitialized++;
                } else {
                    counts.initialized++;
                }
            }
            return counts;
        }
function countDeclarations ( declarations ) { const counts = { uninitialized : 0 , initialized : 0 } ; for ( let i = 0 ; i < declarations . length ; i ++ ) { if ( declarations [ i ] . init === null ) { counts . uninitialized ++ ; } else { counts . initialized ++ ; } } return counts ; }
Counts the number of initialized and uninitialized declarations in a list of declarations
@param {ASTNode[]} declarations List of declarations
@returns {Object} Counts of 'uninitialized' and 'initialized' declarations
@private
Counts the number of initialized and uninitialized declarations in a list of declarations