You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//a). Define an anonymous function and set it equal to a variable with a normal, non-suspicious name. The function takes one parameter. This will be the fuel level on the shuttle.
//b). You must siphon off fuel without alerting the TAs. Inside your function, you want to reduce the fuel level as much as possible WITHOUT changing the color returned by the checkFuel function.
//b). You need to swipe two items from the cargo hold. Choose well. Stealing water ain’t gonna get us rich. Put the swag into a new array and return it from the function.
//a). Define a function called irs that can take fuelLevel and cargoHold as arguments.
53
-
85
+
letirs=function(fuelLevel,cargoHold){
86
+
return`Took ${definetlyTheShuttleFuelLevel(fuelLevel)}kg of fuel and ${stolenGoods[0]} and ${stolenGoods[1]} from the cargo hold. The remaining cargo hold is ${holdStats(cargoHold)}.`
87
+
}
88
+
89
+
54
90
//b). Call your anonymous fuel and cargo functions from within irs.
55
91
56
-
//c). Use a template literal to return, "Raided _____ kg of fuel from the tanks, and stole ____ and ____ from the cargo hold."
92
+
//c). Use a template literal to return, "Raided _____ kg of fuel from the tanks, and stole ____ and ____ from the cargo hold."
93
+
94
+
console.log(irs(fuelLevel,cargoHold));
95
+
96
+
//KT - not sure why I'm getting meel twice on the output
97
+
//KT - I'm not sure how to do step 4, liberating the cargo
98
+
// and collect a new array I can use in the template literal
99
+
// or how to make it general so it just picks the best things for me
0 commit comments