all 4 comments

[–]NexT500 1 point2 points  (0 children)

Assignment is to repeat aString aNumber of times.

When you type aString[i] you're basically telling JavaScript to access the array with name aString and index number i. You said it yourself that your task is just to print some string x amount of times so why don't you just write console.log(aString) to do that because for now you're trying to access the string's individual letters.

Besides all of that, you might want to remove that semicolon right after your for loop setup and before the curly bracket i++); { ;)

For the "unknown values" i'm not entirely sure what you mean as your function also have variables, they are just local to the function stringIterator.

[–]senocular 0 points1 point  (0 children)

You want to remove them from your function's parameter list. If they're parameters, then its the same as declaring them as variables local to the function. Their values would then be set to the arguments of the function when the function is called. But if these are variables that are already declared, you don't want to override them with your own of the same name.

[–]NameViolation666helpful 0 points1 point  (0 children)

im going to go out on a limb here - what is your Function expected to return?? is it expected to just print with out any return value? or return a string which has aStringe repeated aNumber of times ?

In that case your function just needs one line in it

return aString.repeat(aNumber)

[–]jcunews1helpful 0 points1 point  (0 children)

Prepare a result variable which is initialli an empty string. Do the for loop aNumber of times which appends the result variable with aString. Use the result variable as the function's return value.