Homework for beginners JS

we gave the variable " writeAtThePosition" 3 values, they are the names of what we find in the function
the “for” should look from 0 to 6 and stop
then you should somehow gather" i" with the" word" variable at the position at which it stops

this is the function definition that also define the parameters
this line here is not doing what you want:

Your logic may need a few adjustments but your bigger issue is the wrong syntax

i <= string you are comparing a number to a string, it gives false
to loop over a string you need to go from 0 to the string length

this the most it can gives you is something like sstrawberries14

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.