I tried my usual test of live environments
let x=0;
while (x < 10) {
b.textContent=x;
x+=1;
}
You can cut and paste it, but you can't type it in.