E529 Docs: Add -0 and BigInt zeros to _.compact falsey values list by mughees-raza · Pull Request #6062 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@mughees-raza
Copy link
Contributor
@mughees-raza mughees-raza commented Dec 9, 2025

Summary

Updates _.compact documentation to include -0 and 0n in the list of falsey values.

Closes #5779

Changes

  • Updated _.compact documentation to include -0 and 0n as falsey values

Background

JavaScript has additional falsey values that were not previously documented:

  • -0 (negative zero) - Boolean(-0) returns false
  • 0n (BigInt zero) - Boolean(0n) returns false

The _.compact function already filters these values correctly since it uses truthiness checks internally, but the documentation did not reflect this behavior.

@mughees-raza mughees-raza changed the title 5779 Docs: Add -0 and BigInt zeros to _.compact falsey values list Dec 9, 2025
@mughees-raza mughees-raza force-pushed the 5779 branch 2 times, most recently from 1b14cef to 9ba80b8 Compare December 9, 2025 12:16
feat: update falsey values to include BigInt zeros and negative zero
Co-authored-by: Jordan Harband <ljharb@gmail.com>
@jonchurch jonchurch merged commit b5e6729 into lodash:main Dec 18, 2025
30 checks passed
@mughees-raza mughees-raza deleted the 5779 branch December 25, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Description of compact is incomplete.

3 participants

0