Skip to content

Files

Latest commit

 

History

History
25 lines (17 loc) · 494 Bytes

Style-ConcatArrayLiterals.md

File metadata and controls

25 lines (17 loc) · 494 Bytes

Pattern: Missing use of Array#push(item)

Issue: -

Description

Enforces the use of Array#push(item) instead of Array#concat([item]) to avoid redundant array literals.

Examples

# bad
list.concat([foo])
list.concat([bar, baz])
list.concat([qux, quux], [corge])

# good
list.push(foo)
list.push(bar, baz)
list.push(qux, quux, corge)

Further Reading