Typescript task

We’re doing typscript
Our first task is : make an empty array with the name ‘numbers’
fill this array with the numbers 100 to 200 us a for loop
Use a while loop to print these numbers on the console
and then it says use a for loop to print only numbers that are divisible by 3

this is what i got right now
Schermafbeelding 2021-02-26 om 19.05.46

thanks in advance

For future reference, don’t post images of code, instead, paste the code in here by wrapping it in triple backticks (three backticks, then code, then three more backticks). You can also click on the </> button in the editor to help you do this.

As for your project:

“fill this array with the numbers 100 to 200 us a for loop”

I see you have the for loop. My question to you is, if you only need to fill the array with numbers from 100 to 200, why are you starting the loop counter (i) at 0?

Also, if you do not know how to add a number to the end of an array then google ‘javascript add number to end of array’ and you will get more then enough helpful links on how to do this.

1 Like

“numbers” is not spelled “getallen”.

And do you understand what JS function is used to push things into an array?