Do/While Loops


I'm getting the hang of the different loops but have a question about my code. The code below works correctly but was crashing because I had the ending

getToDaChoppa(0) instead of the correct getToDaChoppa(1).

In an earlier lesson I needed to make my beginning variable, in this case "cats(0)"; equal to the number inside the () at the ending function. Can someone please explain in depth why my ending getToDaChoppa(1) needs to have (1) instead of (0), and why it was opposite in the earlier exercise. I really want to understand this in depth, thank you! Here is my working code:

var cats = 0
var getToDaChoppa = function(cats){
do { console.log("Get Dowwwwwwn!");
while (cats === 0) {
console.log("I can't make it!");
cats = 1;





You cannot combine the do-while-loop and the while-loop
like you are doing....

the for-loop:

the while-loop:

the do-while-loop:


google search
== the Book ==
javascript [your question]

== discussions / opinions ==
javascript [your question]

== guidance ==