Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 751 Bytes

no-andself.md

File metadata and controls

27 lines (17 loc) · 751 Bytes

$.fn.andSelf() replaced by $.fn.addBack()

The .andSelf() method has been renamed to .addBack() as of jQuery 1.9 to better reflect its purpose of adding back the previous set of results.

Replace any use of .andSelf() with .addBack().

Rule Details

Examples of incorrect code for this rule:

$('.foo').find('.bar').andSelf()

Examples of correct code for this rule:

$('.foo').find('.bar').addBack()

Further Reading