Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

remove null and undefined from array

// Removing null,undefined,0 value from array

const data = ['Abc',0,null,"Hello",undefined]

const filterData = data.filter(Boolean);

console.log(filterData)
 
PREVIOUS NEXT
Tagged: #remove #null #undefined #array
ADD COMMENT
Topic
Name
3+7 =