How do these two different position of return statements affect the code and why? [duplicate]

Notice the different positions of the words return. How do they actually affect the output differently?

let babyNames = []
const convertToBaby = (arr) => {
  for (let i = 0; i < arr.length; i += 1) {
    babyNames.push('baby ' + arr[i])
  }
  return babyNames
}

const animals = ['panda', 'turtle', 'giraffe', 'hippo', 'sloth', 'human'];
console.log(convertToBaby(animals))
let babyNames = []
const convertToBaby = (arr) => {
  for (let i = 0; i < arr.length; i += 1) {
    babyNames.push('baby ' + arr[i])
    return babyNames
  }
}

const animals = ['panda', 'turtle', 'giraffe', 'hippo', 'sloth', 'human'];
console.log(convertToBaby(animals))