I created two functions and a global object data. I am trying to split what a person inputs inside a text area into individual strings and push them in the global object. The Error I have says userInputParam.split is not a function.
let data = {
userInput: [],
splittedInput: [],
slicedInput: [],
};
function updateUserInput(data) {
if (data.userInput.length == 0) {
// console.log("You can do this Panda!")
data.userInput.push(input.value);
//input.value is what a user inputs in a textarea.
splitUserInput(data.userInput)
}
}
function splitUserInput (userInputParam){
let splittedInput = userInputParam.split(/([*/+-])/)
//console.log(splittedInput)
}