Explorar el Código

parse int to remove warning

Bernadette Elena Hammerle hace 3 años
padre
commit
0ff759487a
Se han modificado 2 ficheros con 2 adiciones y 2 borrados
  1. 1 1
      src/Addition.js
  2. 1 1
      src/Subtraction.js

+ 1 - 1
src/Addition.js

@@ -169,7 +169,7 @@ function Addition() {
       let row = table.insertRow();
       let cell = row.insertCell();
       let cellText = nos[noIdx].join("");
-      if(noIdx == nos.length-1){
+      if(parseInt(noIdx) === nos.length-1){
         cellText = "+ " + cellText;
       }
       cell.innerHTML = cellText;

+ 1 - 1
src/Subtraction.js

@@ -172,7 +172,7 @@ function Subtraction() {
       let row = table.insertRow();
       let cell = row.insertCell();
       let cellText = nos[noIdx].join("");
-      if(noIdx == nos.length-1){
+      if(parseInt(noIdx) === nos.length-1){
         cellText = "- " + cellText;
       }
       cell.innerHTML = cellText;