Given the following JavaScript code: <script language=javascript type=\"text/jav
ID: 3851461 • Letter: G
Question
Given the following JavaScript code:
<script language=javascript type="text/javascript">
for (i=0;i < 10; i++) {
document.write(i);
}
</script>
1.How would you modify the code so that it prints the numbers backwards? Please list your codes.
2.How would you modify the code so that it prints only the even numbers? Please list your codes.
3. How would you modify the code so that it sums all the values of i and prints the final sum? Please list your codes.
Explanation / Answer
2. you should try something like this
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.