Answers for "only shows last 2 characters from string and other show as * in javascript"

8

javascript string get last two character

var member = "my name is Mate";

var last2 = member.slice(-2);

alert(last2); // "te"
Posted by: Guest on September-23-2020
0

last five characters of string javascript

var hello = "Hello World";

var last5 = hello.slice(-5);

alert(last5); // "World"
Posted by: Guest on June-28-2021

Code answers related to "only shows last 2 characters from string and other show as * in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language