New course! Every coder should learn Generative AI!
Try a free lesson+ 4
There are a few problems with your code, mainly with your operators.
Try this and tweak it to suit your purpose.
var depth = 33
//The next part is my code
var climb = 0
var days = 0
while (climb < depth) {
climb += 7
if (climb > depth) {
break;
}
climb -= 2
days++
}
console.log(days)