I am facing a really weird problem in JavaScript where I have a really basic if statement comparing two numeric values and whether the new one is smaller than the old one and if yes put the new value in its place. For some reason, if the old number was 5 for example and the new one is 0, instead of having the 5 becoming a 0 it just takes the value of the next number lets say 3 for example.
Something also very weird is when let's say the current number is -6000 and the new number which is about to be checked is -3000. For some reason instead of -6000 staying since it is a lower number -3000 becomes the new number!
In the picture link below hopefully, you can understand better what I mean and possibly help me fix the problem.Link to the Picture (please click!)
Code:
// Math for min and max is done here
if (theValueArray[y] < tmpLowestValue[y]) {
console.log(tmpLowestValue[y]);
console.log('From: '+finalData[t].min[y]);
finalData[t].min[y] = theValueArray[y];
console.log('To: '+finalData[t].min[y]);
}
Aucun commentaire:
Enregistrer un commentaire