Software Galaxy

Software Galaxy

A Tricky Javascript code snippet

Vivek's avatar
Vivek
Sep 07, 2025
∙ Paid
Share

What's the output of the code below - and why?

const nums = [0, 1, 2, 3];
const filtered = nums.filter(Boolean);

console.log(filtered);

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Vivek
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture