js get last 4 digits

130

js get last 4 digits -

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

Comments

Submit
0 Comments