I have an array of strings
var arr = ['welcome', 'test', 'the', 'nothing'];
Now I want to find all strings that have 4 or more letters. I use the following code but it only returns one string.
for ( var i = 0; i < arr.length; i++) {
if (arr[i].length >= 4) {
return arr[i];
}
}
How can I return all strings with 4 or more letters? Thanks in advance.