I have an object with 3 fields: num which int, str which string and arr which array. So I define it:
function myClass(num, str, arr) {
this.num = num;
this.str = str;
this.arr =arr;
}
Now I have function, which it return value is myClass. This function get string:
function myfunc(str){
var str1 = str.split(" ");
return myClass(1, str1[0], str1);
}
but when I run it, it returns undefine. How I return the myClass object?