Sfoglia il codice sorgente

redundant lines of coder removed

miskson 3 anni fa
parent
commit
e8dde2aa0d
1 ha cambiato i file con 1 aggiunte e 6 eliminazioni
  1. 1 6
      hw1/script.js

+ 1 - 6
hw1/script.js

@@ -54,8 +54,6 @@ let currentSlide = 0
 function truncateFraction (number) {
     try {
         let strNum = String(number).split('.')
-        console.log(strNum)
-        console.log(strNum[1].length)
         if(strNum[1].length > 3) {
             strNum[1] = strNum[1].slice(0, 3)
         }
@@ -75,7 +73,6 @@ function isValidInput (value) {
 
 function invokeError(bool, element, dependent) {
     try {
-        console.log(bool)
         if(bool) {
             if(element.getElementsByTagName('small')[0]) {
                 element.getElementsByTagName('small')[0].remove()
@@ -108,16 +105,15 @@ container.addEventListener('input', (e) => {
 })
 
 reader.addEventListener('click', (e) => {
-    console.log(e.target.id)
     switch(e.target.id) {
         case 'goleft':
             if(currentSlide <= 0) {
                 currentSlide = texts.length - 1
-                console.log(currentSlide)
             } else {
                 currentSlide--
             }
             break;
+            
         case 'goright':
             if(currentSlide >= texts.length - 1) {
                 currentSlide = 0
@@ -126,7 +122,6 @@ reader.addEventListener('click', (e) => {
             }
             break;
     }
-    console.log(e.currentTarget)
     reader.getElementsByTagName('h2')[0].innerHTML = texts[currentSlide].title
     reader.getElementsByTagName('p')[0].innerHTML = texts[currentSlide].text
     reader.getElementsByTagName('p')[1].remove()