const arr = ["Hello", "", "king", "", "queen", "", "early"]; const result = arr.filter(e => e); console.log(result); // ["Hello", "king", "queen", "early"]