Computer Science, asked by Ramandipkaur7991, 11 months ago

How to get the last element in JavaScript array?

Answers

Answered by kaustubdevadiga18
0

var linkElement = document.getElementById("BackButton");

var loc_array = document.location.href.split('/');

var newT = document.createTextNode(unescape(capWords(loc_array[loc_array.length-2])));

linkElement.appendChild(newT);

hope this answer is helpful

Similar questions