I'm a begginer and I'm coding this to change values of a whole array. For instance, my aim is to change ºC to ºK. But this code doesn't seems to work. It gives an error message: "j is undefined". What's wrong with this code?
//Original Arrays
var I_t1=new Array();
var V_t1=new Array();
//Arrays de la tabla 1
var K_t1=new Array();
var P_t1=new Array();
function kelvin() {
var i;
var j = new Array();
var k = new Array();
var k;
var j=V_t1.lenght;
var k=I_t1.lenght; // La k será igual a la longitud del array T
for(i=0;i<j.length;i++){
K_t1[i]= (V_t1[i] * 200);
}
for(i=0;i<k.length;i++){
P_t1[i]= (I_t1[i] * 400);
}
}
Until here, the code. So my question is:
-How do I modify this funcion to archieve its aim?
kin thekelvinfunction a total of 3 times andjtwo times - why? Thirdly,I_t1.lenghtshould beI_t1.length. Fourthly, you're settingjandkto a NUMBER, yet you're trying to call.lengthon them and a number doesn't have a length. Skip out the.lengthpart in theforstatements.