Advertisement
GalinaKG

Untitled

Mar 17th, 2022
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. function barcodeGenerator (input) {
  2. let start = input[0];
  3. let end = input[1];
  4. let currentNum = ""
  5.  
  6. for (let j = Number(start.charAt(0)); j <= Number(end.charAt(0)); j++) {
  7. for (let k = Number(start.charAt(1)); k <= Number(end.charAt(1)); k++) {
  8. for (let h = Number(start.charAt(2)); h <= Number(end.charAt(2)); h++) {
  9. for (let m = Number(start.charAt(3)); m <= Number(end.charAt(3)); m++) {
  10.  
  11. if (j % 2 !== 0 && k % 2 !== 0 && h % 2 !== 0 && m % 2 !== 0) {
  12. currentNum = currentNum + j + k + h + m + " ";
  13. }
  14. }
  15. }
  16. }
  17.  
  18. }
  19.  
  20. console.log(currentNum)
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement