If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

New at this

I need help. I am taking an intro course in JS and I need help with some practice questions from my textbook that I can't get to work on my computer.

I have to write 3 functions with while loops in them. One to count the number of whitespaces in a string (my teacher recommended accessing it like an array but I haven't been able to do that), one that takes in two numbers and sees how many times the first goes into the second by adding, and the last one is to see if an array contains any positive numbers. My code is below for what I have done. I appreciate any guidance and assistance. Thanks!

- There is no argument for the "if". if (arguments) {code to excute}.
-There is no array named "howManySpaces".
- "index" is undefined.
-'' indicate empty. Space ' '.
I think the code could be something like: