Note: I'm new in JavaScript, so i'm unable to search and understand matters about JS if this question related with others questions. I think this is the platform for asking question.
I'm trying to understand basic While Loop statement, I'm counting 0 to 9 as given below:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script type="text/javascript">
var myCounter = 0;
var linebreak = "<br />";
document.write(linebreak);
while(myCounter < 10){
document.write("My Counter = " + myCounter);
document.write(linebreak);
myCounter++;
}
document.write("While loop is finished!");
</script>
</body>
</html>
My question is what is the role of myCounter++;
and what does it mean? why ++
?