const arr = ["hello", false, 0, "", 7, true, "0", [], {}, null];
const filteredValues = arr.filter(Boolean);
console.log(filteredValues); // [ 'hello', 7, true, '0', [], {} ]
Thanks for reading 💙
Follow @codedrops.tech for more.
Instagram ● Twitter ● Facebook
Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript
codedrops.tech
Projects
Note Box - A chrome extension to add notes/todos based on URL
File Ops - A VS Code extension to easily tag/alias files & quick switch between files
Top comments (1)