i would like to know if theres a way to write this code without the need of a class?
bodydata is an array:
and the line i want to use:Code:var bodydata = new Array();
but to use it i need this class:Code:bodydata.push(new bodycalc("178,80"));
i would like to do the same but without the class, is that possible?Code:class bodycalc { var height, weight; function bodycalc(str) { var _loc1 = str.indexOf(",", 0); height = Number(str.substr(0, _loc1)); weight = Number(str.substr(_loc1 + 1, str.length)); } // End of the function } // End of Class
so i can use bodydata[0].height, bodydata[1].weight and so on...




Reply With Quote