Say hi to the group with a function


Version 4: Call a function within the loop

https://codepen.io/joe_bacal/pen/qjzepX

javascript
const people = ['Sarah', 'Jose', 'Orhan'];

function sayHi(someonesName){
  console.log('Hi ' + someonesName );
}

for ( var i = 0; i < people.length; i++ ){
  sayHi(people[i]);
}

"Hi Sarah" "Hi Jose" "Hi Orhan"

results matching ""

    No results matching ""