@dovca
, I see your point on calling it statements instead of functions, I will correct it to that effect.
The reason for using the .reverse() method was explained in the article, just above that section. Seeing this other approach I will, add that to the article and give due credit.
Setting the index to 1 will not work for the while loop cause at first iteration the value of index will become 1 because of the increment in the condition. However initializing index to -1 will work.
Thank you.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
@dovca , I see your point on calling it statements instead of functions, I will correct it to that effect.
The reason for using the
.reverse()
method was explained in the article, just above that section. Seeing this other approach I will, add that to the article and give due credit.Setting the index to 1 will not work for the while loop cause at first iteration the value of index will become 1 because of the increment in the condition. However initializing index to -1 will work.
Thank you.