Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 620 Bytes

no-each-collection.md

File metadata and controls

31 lines (23 loc) · 620 Bytes

no-each-collection

Disallows the .each method. Prefer Array#forEach.

📋 This rule is enabled in plugin:no-jquery/all.

Rule details

❌ Examples of incorrect code:

$( 'div' ).each();
$div.each();
$( 'div' ).first().each();
$( 'div' ).append( $( 'input' ).each() );

✔️ Examples of correct code:

each();
[].each();
div.each();
div.each;
$.each();

Resources