I have a text field in which the user inputs some text. I'd like to take the first word of that text and turn it into a global variable name for an object holding the rest of the string content. More string content will be added to object later, so internal indexing inside the object is required.
var textInput = $('#inputText').val();
var splitString = textInput.split(" ");
var firstWord = splitString[0];
This is where I get stuck. How please do I create a new object with the string referenced by firstWord as the object's reference?
Many thanks in advance.