Last active
June 7, 2020 10:18
-
-
Save Melkanea/9fe9a0871ea8454b3742c40b281043da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Melkaneas Tribute Pet Project -- Kimberly SandwichMaker v2 | |
var sandwichmaker = { | |
topsList: "", | |
toppings: [], | |
toppingCount: 5, | |
sandwichmaker: function () { | |
for (var i = 0; i < this.toppingCount; i++){ | |
var topsTemp = prompt("please add your favorite toppings"); | |
this.toppings.push(topsTemp); | |
} | |
}, | |
showSand: function (toppings) { | |
topsList = "<ul>" + "BREAD" + "<br>"; | |
for (var i = 0; i < toppings.length; i++) { | |
topsList += "<li>" + toppings[i] + "</li>" + "<br>"; | |
} | |
topsList += "BREAD" + "</ul>"; | |
this.topsList += topsList; | |
}, | |
debug: function () { | |
console.log(this.tops); | |
console.log(this.topsTemp); | |
console.log(this.topsList); | |
console.log(this.toppings); | |
console.log(topsList); | |
} | |
} | |
sandwichmaker.sandwichmaker(); | |
sandwichmaker.showSand(sandwichmaker.toppings); | |
document.write(sandwichmaker.topsList); | |
//sandwichmaker.debug(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I hope you like it now that i have finished with the beginners JS course