I have an array like this:
var CutRoadArray = [
['Location', '_Location'],
['Applicant Info', '_ApplicantInfo'],
['Details', '_ApplicationDetails'],
['Bond Info', '_BondInfo'],
['Attachments', '_Attachments'],
['Review', '_ReviewA']
];
I am trying to replace the last item, with a different entry.
The code I have so far goes like below:
var newreviewElem = ['Review', '_ReviewB'];
var index = CutRoadArray.lastIndexOf('_ReviewA');
CutRoadArray.splice(index, 0, newreviewElem);
console.log(CutRoadArray);
This is however not working. What am I doing wrong ?