Skip to content

itemAt helper returns null when item is falsy #7

@gabriel-pinheiro

Description

@gabriel-pinheiro

Describe the bug
The first, last and itemAt helpers return null when the item is falsy.

Template

{{first arr}} is {{typeof (first arr)}}

Context

{
    "arr": [0, 1, 2]
}

Broken Output

 is object

Expected Output

0 is number

Additional information
In the helper definition || is used instead of ?? (nullish coalescing operator):
array.ts:8, array.ts:16, array.ts:27

If you're confortable with testing, make sure to include tests that assure this is fixed:
array-helpers.spec.js:12

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions