try this
function longest(array, length) {
var result;
var count = 0;
for (var i = 0; i < array.length; i++)
if (array[i].length === length)
count++;
result = count == array.length ? 'they are all ' + length + ' length' : 'one or more of them is not ' + length;
return result;
}
longest(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k'], 1)