Interpolation


#1

Hi,

I was wondering what the purpose of interpolation is. I know there must be a reason to interpolate rather than just using a comma, but I'm not sure what that reason is.

For example, in the exercises we have:

var favoriteAnimal = 'hedgehog';
console.log('My favorite animal: '+ favoriteAnimal);
// Output: My favorite animal: hedgehog

but how is that different than:
var favoriteAnimal = 'hedgehog';
console.log('My favorite animal: ', favoriteAnimal);
// Output: My favorite animal: hedgehog

Thanks!