how to split a string and take the last one in js code example Example: javascript split get last element a = "hello.dear.friends" a.split(".").pop() > "friends"