I’m trying to figure out what I’m doing wrong, why does this code only print out “woo!”
So you have an array of backpacking items but are you not looping through those items. Hence it will always print woo!. Also you are comparing the object holder not the array items hence will not be equal to exaustion.
put a for loop for the backpack and then in the loop put the if statement. I hope that helps.
var backpacking = [
for(var element of backpacking)
if(element === ‘exaustion’)