diff --git a/libs/bluemath.js b/libs/bluemath.js index 5280786..f0c392e 100644 --- a/libs/bluemath.js +++ b/libs/bluemath.js @@ -35,13 +35,13 @@ class vector { } } - add(vec=new vector([...this.d.map(d => 0)]) { + add(vec=new vector([...this.d.map(d => 0)])) { vec = vec instanceof vector ? vec : new vector([0]); var longest = vec.d.length > this.d.length ? vec.d : this.d; var shortest = vec.d.length < this.d.length ? vec.d : this.d; return new vector([...longest.map(function (value,index) { var small = shortest[index]; - if !isNaN(small) { return value + small; } else { return value; } + if (!isNaN(small)) { return value + small; } else { return value; } })]); } @@ -51,7 +51,7 @@ class vector { var shortest = vec.d.length < this.d.length ? vec.d : this.d; return new vector([...longest.map(function (value,index) { var small = shortest[index]; - if (!isNaN(small) { return value * small; } else { value; } + if (!isNaN(small)) { return value * small; } else { value; } })]); }