Great post!
Just wanted to point out that in this part;
// Last element let lastElem = arrayExample[arrayExample - 1];
In order to get the last element you have to count it from the length of the array like this:
let lastElem = arrayExample[arrayExample.length - 1];
Best of luck in your learning process! :)
Ahhh, thank you for pointing that out! I meant to put .length, I will go ahead and fix that.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
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.
Great post!
Just wanted to point out that in this part;
// Last element
let lastElem = arrayExample[arrayExample - 1];
In order to get the last element you have to count it from the length of the array like this:
let lastElem = arrayExample[arrayExample.length - 1];
Best of luck in your learning process! :)
Ahhh, thank you for pointing that out! I meant to put .length, I will go ahead and fix that.