App Lab Growing and Shrinking Code

I have a student who wants to code an object growing and shrinking while someone breathes in and out. Here is some of their code.

Is this the best way to do this?

var pause = 0;
var setShapeSize = 50;
function StartBreathing() {
function breatheIn() {
for (var size = 50; size <= 100; size += 1) {
setShapeSize(size);
pause(10);
}
}
function breatheOut() {
for (var size = 100; size >= 50; size -= 1) {
setShapeSize(size);
pause(10);
}
}
}
function StartBreathing() {
while (true) {
breatheIn();
breatheOut();
}
}

There are the beginnings of a workable idea here, but you’ll want to revisit the use of loops to make it fully functional.

We are all set. Thank you all for helping out- if anyone would like to see what we have here it is: