Obtenga los últimos tres caracteres de String JavaScript
var member = "my name is Afia";
var last3 = member.slice(-3);
alert(last3); // "fia"
Fine Frog
var member = "my name is Afia";
var last3 = member.slice(-3);
alert(last3); // "fia"
var hello = "Hello World";
var lastCharOfHello=hello.slice(-1);//d
var str = "Hello";
var newString = str.substring(0, str.length - 1); //newString = Hell
'abc'.slice(-1); // c
'abc'.slice(-2);
how to get the last character of a string