I have following code
array.filter(Boolean)
this code works fine but
Boolean([])
returns true why ??
Asked
Active
Viewed 26 times
0
Mousa Rahimi
- 1
- 1
-
Why wouldn't it return `true`? Why do you expect `false`? – Pointy Oct 03 '20 at 13:06
-
See also: https://tc39.es/ecma262/#sec-toboolean – NoSkill Oct 03 '20 at 13:10