Question: ```
// Should equal 0 when an empty Array is entered

function getLengthOfShortestElement(arr) {

  var shortestElement = Infinity;

  for(var i=0; i < arr.length; i++) {
    if(arr[i].length < shortestElement) {
      shortestElement = arr[i].length;
    } else if (arr[i].length === 0) {
      return 0;
    } 
  }
  return shortestElement;
}

var output = getLengthOfShortestElement([]);
console.log(output);

```

Judging by the code why isn't it outputting 0? Instead it outputs Infinity..

Answer: 
You should move the `arr.length === 0` outside of the loop, or else it will never run.
Try this instead

```
function getLengthOfShortestElement(arr) {

  var shortestElement = Infinity;

  for(var i=0; i < arr.length; i++) {
    if(arr[i].length < shortestElement) {
      shortestElement = arr[i].length;
    }
  }
  if (arr.length === 0) {
    return 0;
  }
  return shortestElement;
}

var output = getLengthOfShortestElement([]);
console.log(output);

```
I believe it may be that you are checking arr[i].length instead of arr.length because you only check if arr[i].length is 0 and if then the function returns 0, otherwise shortestElement is still equal to infinity and is returned.