1var member = "my name is Afia";
2
3var last3 = member.slice(-3);
4
5alert(last3); // "fia"
1var str = "Hello";
2var newString = str.substring(0, str.length - 1); //newString = Hell
1var member = "my name is Mate";
2
3var last2 = member.slice(-2);
4
5alert(last2); // "te"
1const id = "ctl03_Tabs1";
2console.log(id.slice(id.length - 5)); //Outputs: Tabs1
3console.log(id.slice(id.length - 1)); //Outputs: 1