I have a string in this format
strb= str1+ ' ' + str2
<span>{{strb}}</span>
How can I change this to display it backwards
I have a string in this format
strb= str1+ ' ' + str2
<span>{{strb}}</span>
How can I change this to display it backwards
You can split your string at , to get first name and last name separately. This will literally cut away the parts you pass as a prop to your .split() function and return an array with the leftover pieces of your string.
const names = fullName.split(', '); //['BROWN', 'MARY'];
const firstName = names[1]; //'MARY'
const lastName = names[0]; //'BROWN'