The list function vs the printPerson function


I am just curious why the printPerson function is created without var prefacing it while the list function does have it:

function printPerson(person) {
console.log(person.firstName + " " + person.lastName);
var list = function()
var contactsLength = contacts;
for (x = 0; x < contacts.length; x++) {

Replace this line with your code.


Hi you can create a function like that...

var functionName = function(arg) {
  #do something


function functionName(arg) {
    #do something

it's the same just the structure that's different


Thanks so much for the answer. I wasn't sure if I was missing something. I was examining another help post and the functions were written different ways but ran fine. Have a great day!