I am having issues trying to run a simple function with an array, it runs undefined, but when I console log it I get th right result?
Please can anyone help?
var test = (function (newThing){
newThing = [1,2,3,4,5,6];
var myarray = newThing.map(n=>n*n)
.reduce((a,b)=> {return a+b});
return myarray;
})();