I have a process that returns 4 different pieces of information, each piece separated by an asterisk(*). For example, the code will return something like:
Boy*15*Winter*New Years
I want to split this string into individual and assign values to each piece.
So something like this:
var gender = Boy
var age = 15
var favoriteSeason = Winter
var favoriteHoliday = New Years
But I do not want those variables hard-coded.
Is there a way to do this using javascript?
['gender', 'age', ...]in this case.