Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove empty array

const arr = ["Hello", "", "king", "", "queen", "",  "early"];

const result =  arr.filter(e =>  e);

console.log(result); // ["Hello", "king", "queen", "early"]
Source by reactgo.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #empty #array
ADD COMMENT
Topic
Name
4+5 =