Just quick question, is there a way to call a function and modify a variable at the same time?
Take this,<button onclick="change(); var con = true">click me</button>
<script>
function change() {
while (con == true) {
var x = event.clientX;
var y = event.clientY;
}
//do some more magical stuff
}
</script>
Basically I want to loop the while loop only if the condition is true, and do some more magical stuff at the same time, would that be possible?
con === false? Like Paul said, this is currently an infinite loop.