Say hi to Jose especially


1. Conditionals

https://codepen.io/joe_bacal/pen/RZRWKp?editors=0011

var cats = 7;
var dogs = 3;

if ( cats > dogs ) {
    console.log('Meowww!');
} else {
    console.log('Woof!');
}
Meowww!

2. Conditional in a function

const people = ['Bob', 'Jose', 'Sarah'];

for (var i = 0; i < people.length; i++){
  if (people[i] == 'Jose'){
    console.log('Hi, ' + people[i] + '!!! W0000T!!!');
  } else {
    console.log('Hi, ' + people[i]);
  }
}
"Hi, Bob"
"Hi, Jose!! W0000T!!!"
"Hi, Sarah"

results matching ""

    No results matching ""