Skip to content

Commit

Permalink
[set] fix retrieving first element. closes #90
Browse files Browse the repository at this point in the history
  • Loading branch information
dmonad committed Aug 5, 2024
1 parent 606ce0a commit eef2554
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion set.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const toArray = set => Array.from(set)
* @return {T}
*/
export const first = set =>
set.values().next().value || undefined
set.values().next().value ?? undefined

/**
* @template T
Expand Down

0 comments on commit eef2554

Please sign in to comment.