Hong-Phuc Bui
2025-10-17 0079221776106e3ca91076938e80d37e38eacc29
textbased-programms/luhn.js
@@ -5,7 +5,7 @@
import {terminal} from "./dfhi.js";
window.main = function(...argv) {
window.main = (...argv) => {
   let sumEvent = 0n;
   let sumOdd = 0n;
   let credit = argv[0];
@@ -20,10 +20,10 @@
      n = n/10n;
   }
   console.log({sumOdd, sumEvent});
   let sum =(sumEvent + sumOdd) % 10n;
   const sum =(sumEvent + sumOdd) % 10n;
   if (sum === 0n) {
      terminal.printl(`${credit} maybe OK`);
      terminal.printl(`${credit} may be a valid credit number`);
   } else {
      terminal.printl(`${credit} definitiv Wrong`);
      terminal.printl(`${credit} is not a valid credit number`);
   }
};