I have (for example) string like let abc = \'Jonny_Name\'
, so if i want to check, this is name or not I check:
let isName = abc.split(\'_\')[1];
Array.pop() has no argument - you can use this to get the last element form the split operation
let isName = cba.split('_').pop();
Or you reverse the new array an take the "first" element:
let isName = cba.split('_').reverse()[0]
String.split() takes a second argument for the max length of the returned array. This should help you:
cba.split('_', cba.split('_').length - 1)
or to get it as a string
cba.split('_', cba.split('_').length - 1).join("_")
Running Example
const cba = 'Jonny_Great_Dude_Name';
const isName = cba.split('_').pop()
const rest = cba.split('_', cba.split('_').length - 1).join("_")
console.log({isName, rest})