Created
September 6, 2020 13:35
-
-
Save srezasm/c3bef007701c93772ba9932bc2a019fe to your computer and use it in GitHub Desktop.
last item in array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let array = [0, 1, 2, 3]; | |
array = array.slice(-1); | |
console.log(array); | |
// Result: [3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment