Skip to content

Instantly share code, notes, and snippets.

View kbk0125's full-sized avatar

Kevin Kononenko kbk0125

View GitHub Profile
function packBox(item){
console.log('Put ' +item+ ' in the box');
function addressPackage(address){
console.log('Addressed the box to ' +address+' and ready to send the '+item+' gift');
}
return addressPackage;
}
let box1= ["juice", "sandwich", "chips", "yogurt"];
let box2 = ["milk", "sandwich", "carrots", "chips"];
let total = box1.concat(box2);
let answer = total.filter(function(item){
let box1= ["juice", "sandwich", "chips", "yogurt"];
let box2 = ["milk", "sandwich", "carrots", "chips"];
let total = box1.concat(box2);
let answer = total.filter(function(item){
let box1= ["juice", "sandwich", "chips", "yogurt"];
let box2 = ["milk", "sandwich", "carrots", "chips"];
let total = box1.concat(box2);
let answer = total.filter(function(item)({
let box1= ["juice", "sandwich", "chips", "yogurt"];
let box2 = ["milk", "sandwich", "carrots", "chips"];
let total = box1.concat(box2);
cookout.grill.apply(cookout, this.mealOrders);
// "I am going to cook: chicken, burger, burger, steak, chicken
let cookout = {
mealOrders: ["chicken", "burger", "burger", "steak", "chicken"],
grill: function() {
let args = Array.prototype.slice.call (arguments);
console.log("I am going to cook :" + args.join(","));
}
}
cookout.grill("steak");
// "I am going to fire up the grill to cook steak with soda to drink!"
cookout.grill.call(fancyDinner, "steak");
// "I am going to fire up the grill to cook steak with wine to drink!"
let cookout = {
drink:"soda",
grill: function(meal) {
console.log("I am going to fire up the grill to cook " + meal + " with " +this.drink +" to drink!");
}
}
let fancyDinner = {
drink: "wine",
useOven: function() {}
cookBurger("Jack")
// Thanks Jack! Your burger will be ready in 15 minutes.
cookSteak("Jill")
// Thanks Jill! Your steak will be ready in 10 minutes.
cookChicken("David")
// Thanks David! Your chicken will be ready in 20 minutes.