x
You solved the puzzle!
There's a new one coming soon 😉
March 23rd, 2024
What's missing in this code?
function
getFalseIndexes
(
arr
)
return
arr
.
map
(
(
value, index
) =>
({ value, index}))
.
filter
(
(
{ value }
) =>
!value)
;
}
getFalseIndexes
([
true
,
false
,
true
,
false
]);
// [1, 3]
getFalseIndexes
([
true
,
true
,
true
,
true
]);
// []
Type or select from these options
.map(({ index }) => ({ index }))
.map(({ index }) => index)
.filter((index) => Boolean(index))
.map((index) => index >= 0)
.map(Boolean)
CHECK