DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
javascript get the last array element
const
myArray
=
[
1
,
2
,
3
]
console
.
log
(
myArray
.
item
(
-
1
)
)
//=> 3
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#javascript
#array
#element
ADD COMMENT
Topic
COMMENT
Name
4+6 =
Submit