Anonymous and Named Functions
var dirtyFunction = function() {
console.log('scrub a dub dub');
};
dirtyFunction();
var isItLunchYet = function() {
return "soon";
};
isItLunchYet();
function getLunch() {
return "foodz";
}
function getFoodComad() {
return "zzzZZZZzzz";
}
getLunch();
getFoodComad();
function poppingBottles() {
return 'poppin bottles in the club, like a g6';
}
function sailOnMagicCarpet(yourName, yourFriend, makeMagic) {
console.log('I can show you the world, ' + yourFriend);
console.log('Would you like to ' + makeMagic() + ' with me?');
console.log('I am the king of the world, named ' + yourName);
return 'hell yeah';
}
sailOnMagicCarpet('Jimbo Jones', 'Kevin Dorian', poppingBottles);
console.log(typeof sailOnMagicCarpet);