if you want to find last element value from an Array using Javascript so I am explaining you how to get last value in array. let’s see example how to get last value :
<script>
var cities = ['indore', 'betul', 'bhopal', 'khargone', 'rau'];
var lastresult = cities[cities.length - 1];
document.write('Last Element of array:-'+ lastresult );
console.log(lastresult );
</script>
Last Element of array:-rau
Hello, Welcome to webdeveloperindia.in. I am a full-stack web developer. Email – [email protected] | Skype – azaruddin23. I have knowledge of PHP, Laravel, Magento 1/2, Codeigniter, WordPress, Joomla, Shopify, Git, Bitbuket, jQuery, Ajax, Javascript and ReactJS.
Good Job! Thanks!!