Reputation: 185
So this is super simple stuff but for some reason i cant figure out what i am doing wrong. My hash simply wont return the output of my function. any help would be greatly apperciated
myArray = ["firstname lastname", "emailadress"];
var splitName = function(string){
var final_string = string.split(" ");
console.log(final_string);
};
var result = splitName(myArray[0]);
console.log(result); // this returns undefined
myData = {
fullName : splitName(myArray[0]),
};
console.log(myData); //still returns undefined
Upvotes: -1
Views: 82