Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 455 Bytes

Performance-ReverseFirst.md

File metadata and controls

23 lines (15 loc) · 455 Bytes

Pattern: Missing use of last(n).reverse/last

Issue: -

Description

Identifies places where reverse.first(n) and reverse.first can be replaced by last(n).reverse and last.

Examples

# bad
array.reverse.first(5)
array.reverse.first

# good
array.last(5).reverse
array.last

Further Reading