<title>Assignment 5</title>
a. Name the new function myNewFunction() ?
function myNewFunction(){
b. Write a for loop from 1 to 100, loop must iterate 100 times, not 99 or 101 times
for (i = 1; i <= 100; i++) {
c. Within the for loop, use a series of if, else if, and else statements to evaluate if the remainder of the iteration divided by a particular number is zero
for (i = 1; i <= 100; i++) {
d. Let the value of the iteration be a variable (var) named i:
i. If i % 3 == 0 && i % 5 == 0, use the function console.log(“Hello World”)
ii. Else if i % 3 == 0, console.log(“Hello”)
iii. Else if i % 5 == 0, console.log(“World”)
for (i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0){
console.log("Hello World");
( to call our function we just have to use this command or we can add a button
<button onclick="myNewFunction()">Run Script</button> )
<script type="text/javascript">
function myNewFunction(x){
for(vari=x; i<=100; i++){