Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 629 Bytes

no-map-collection.md

File metadata and controls

32 lines (24 loc) · 629 Bytes

no-map-collection

Disallows the .map method. Prefer Array#map.

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

Rule details

❌ Examples of incorrect code:

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

✔️ Examples of correct code:

map();
[].map();
div.map();
div.map;
$.map();
$( 'select' ).val().map();

Resources