Skip to content

Instantly share code, notes, and snippets.

View kbk0125's full-sized avatar

Kevin Kononenko kbk0125

View GitHub Profile
// generic reportOrders that shows your orders to the function
function reportOrders (minionOrders) {
if ( typeof minionOrders === "string"){
console.log(minionOrders);
}
else if ( typeof minionOrders === "object"){
for (var item in minionOrders) {
console.log(item + ": " + minionOrders[item]);
}
}
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;
}
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 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)({
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!"