Given an array of mixed types, "getLongestWordOfMixedElements" returns the longest string in the given array.
Notes:
- If the array is empty, it should return an empty string ("").
- If the array contains no strings; it should return an empty string.
How do I find out if the array contains a string or not, as in this code:
function getLongestWordOfMixedElements(arr) {
    if (arr.length === 0) return ""
    var max = 0
    for (var i = 0; i < arr.length; i++){
        if(arr[i].length > max) max = arr[i]
    }
    return max
}
getLongestWordOfMixedElements([3, 'word', 5, 'up', 3, 1]);
 
     
     
     
    