js get last 4 digits
snippet in javascript

js get last 4 digits

user7453

const id = "ctl03_Tabs1";
console.log(id.slice(id.length - 5)); //Outputs: Tabs1
console.log(id.slice(id.length - 1)); //Outputs: 1

javascript get last n characters of string

user6448

'abc'.slice(-1); // c

how to get last string in javascript

user6795

'abc'.slice(-2);