var myAge = 29;
var myName = "Pamela";
var isSheCool = true;
...what other data types are there?
var calculateFoodNeeded = function(numDays) {
return numDays * 3;
};
var makeFunnyName = function(firstName, lastName) {
return "Miss " + firstName + " Mc" + lastName + "Pants";
};
var movieIsActionFlick = true;
var movieCost = 0;
if (movieIsActionFlick === true && movieCost < 1) {
console.log("Okay fine I'll watch it");
}
var movieHasBradPitt = true;
var movieHasJohnnyDepp = false;
if (movieHasBradPitt === true || movieHasJohnnyDepp === true) {
console.log( "I'll DEFINITELY watch it");
}
if (movieHasBradPitt) {
console.log( "Def watch it" );
} else if (movieCost === 0) {
console.log( "Free, might as well");
} else if (movieIsActionFlick) {
console.log("Nah I don't like action flicks");
} else {
console.log( "I cant decide!");
}
var countdown = 10;
while (countdown > 0) {
console.log(countdown);
countdown--;
}
var countdown = 10;
while (countdown > 0) {
if (countdown > 1) {
console.log(countdown + '...');
} else {
console.log(countdown + '!');
}
countdown--;
}
for (var i = 10; i > 0; i--) {
console.log(i);
}
var children = ['Oliver', 'Pamela', 'Hunter'];
console.log('My dad has ' + children.length + ' children');
console.log('His first kid was ' + children[0]);
children.push('Alexis');
console.log('His fourth kid was ' + children[3]);
for (var i = 0; i < children.length; i++) {
console.log('Kid #' + (i + 1) + ': ' + children[i]);
}
var myCrazyCat = {
name: "Angel",
age: 3,
likes: ["rubber bands", "boxes", "4am petting sessions"],
fur: {
colors: ["orange", "white"],
pattern: "striped"
}
};