Created
April 9, 2021 09:08
-
-
Save IKatsuba/503349c820b1e3e284655aae74df126a to your computer and use it in GitHub Desktop.
The last getter example
This file contains hidden or 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
| const items = [1, 2, 3, 4]; | |
| //before | |
| const last = items[items.length - 1]; | |
| //after | |
| const last = items.last; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment