I have (for example) string like let abc = \'Jonny_Name\', so if i want to check, this is name or not I check:
let abc = \'Jonny_Name\'
let isName = abc.split(\'_\')[1];
const abc = 'Jonny_Great_Dude_Name'; const splitted = abc.split(/_/); const [other, name] = [splitted.pop(), splitted.join('_')]; console.log({name:name, isName: other == 'Name'});