This time I did try and run it on console, but couldn’t seem to get it to work.
Here is the algorithm
msg = 'codingdojo';
for(var x = -1; x < msg.length - 1); x++)
{
if (msg.length == 1){
for (var i = 1; i < 4; i++){
console.log(i);
}
}
else
{
for (var i = msg.length; i > (msg.length - 2); i--){
console.log(i);
}
}
}
If anyone could help would be much appreciated thank you