I want to define my own loop in javascript. Already existing loops are:- for and while.
I have tried using define(during,while); but that didn't work. For example, it might be easier for someone who speaks spanish to use mientras instead of while. In C, I know you can
write
#define mientras while, but I can't find a way to do this in JavaScript.
do {
//code goes here
} mientras (/*condition*/);
and it would work. I also tried
var during = while;
I also tried
function during(e) {
while(e){
}
}
Is this even possible?
ctag. This question is about JavaScript, not C. (The C example in the question is useful to understanding what you want, though.)