Procházet zdrojové kódy

parse int to remove warning

Bernadette Elena Hammerle před 3 roky
rodič
revize
0ff759487a
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  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;