I can't find a solution for this question: a function should return an array by breaking up the input string into individual words. For example "John Smith" should be returned as ["John", "Smith"].
I have:
var myArray = new Array();
myArray[0] = "John Smith";
function breakingName() {
var fullName = myArray[0];
var splitting = fullName.split(" ");
return splitting; // not sure why but it doesn't resolve the above challenge
}
myData = new Object();
myData.fullName = breakingName();
Thanks for your help.