- Make sure to git add .
- git commit -m " with a message "
- git push
After each π make a add,commit,push
Inside Main.js do the following code from below
(make sure to call the functions)
π 1a. Make a function that takes in two
parameters and returns the sum of them both
π 1b. Make a function that takes in two
parameters and returns one number minus another.
π 1c. Make a function that takes in two
parameters and return the multiplication of them both
π 1d. Make a function that takes in two
parameters and return the division of them both
π 2a. Make an if statement that logs helloword
to the browser
π 2b. Create a function that takes in a number and checks if
a number is higher then 5 ,if the number is heigher then 5 log the string im heigher then 5
, else log the string lower then 5
π 2c.
- Create a function that takes in a number.
- Create a variable inside of the function, call it
number
and set it to the number 10. - inside the function check if the number passed in from the function is heigher then 5, if it is add 5 to the variable called number and console.log it
- else console.log the string
not added
π 3a.
- Create a variable called savedNumberArray and set it to an empty Array
- Create a function called addNumberToArray that passes in a number
- Add the number to the Array
- Call the function
- Change the number and console.log the array to see if the number has been added
π 4a. Make a for loop that loops to the number 10
and logs the string i can count to this number
π 4b. Create a functions called looping and put task3-3a ^
above code inside of it and call it.
π 4c.
- Create a function called AddingOnLoops
- Create a vairable called myNumbers and set it to 0
- Create a for loop inside of the function that loops to 5
- inside the for loops add 3 to the variable myNumbers
- console.log myNumbers after the for loop
your result should be 15 in the console
π₯BONUS TASK-1:
- Declare a variable called MyArray set it to an empty Array.
- Below the array create a function called addToArray
- inside the function add a for loop that loops to 10 and adds the number 5 to the above MyArray Vairable on each itteration
π₯BONUS TASK-2:
- Declare a variable called MyArray set it to an empty Array.
- Below the array create a function called addToArray
- inside the function add a for loop that loops to 10 and adds the number 5 to the above MyArray Vairable on each itteration