Free Puzzle Questions with Answer using Java, C#, JavaScript and PHP

JavaScript - For Loop and While Loop Statements

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script language="JavaScript" type="text/javascript">
        for(var i=1; i <= 10; i=i+1){
            document.write(i);
            document.write("<br/>")
        }

        var value = 1;
        while(value <= 20){
            document.write(value);
            document.write("<br/>");

            value = value +1;
        }
    </script>
</body>
</html>