get last element in array in javascript
arr.slice(-1)[0]
if (loc_array[loc_array.length - 1] === 'index.html') {
// do something
} else {
// something else
}
Also in JavaScript:
- how to get json array response in retrofit
- $() jquery document
- less than equal to in javascript
- javascript getelementbyid
- vuetify event handler
- react native text input number only
- preventive vs reactive
- download .json file
- react native onChangeText resize the background image
- PayloadTooLargeError: request entity too large
- javascript reduce method stack overflow
- input not detecting text
- javascript toisostring without milliseconds
- javascript charcode
- find particular object from array in js
- extendscript unzip file
- jquery close another dialog
- regex char or char
- jquery example sheetjs
- Vue is not defined
- jstring to char*
- react native shadow android
- include js in html
- search array for property js