flizesther
3/14/2019 - 12:06 PM

conditionals.js

var galletas = "yayitas";
var chicken = ['chickenrun', 'other'];
if (galletas == "yayitas"){console.log("me gustan")}
else {console.log("no me gustan")};

var helado = ["naranja", "platano"]
if (helado[0] == "platano") {console.log("qué rico")}
else {console.log("qué malo")};
if (galletas === "yayitas" && chicken[1] === "other") {console.log("me gustan")}
else {console.log("no me gustan")};



let elements = [10,20,30];
let mayor = -1; 
for (let i=0; i<elements.length; i++) {
  if (elements[i] > mayor){
    mayor = elements[i];
  }
}
console.log ("el elemento mayor es "+ mayor);