Skip to content

Commit

Permalink
only change if different
Browse files Browse the repository at this point in the history
  • Loading branch information
axhon committed Mar 26, 2018
1 parent 11bff90 commit baf7a2a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions digital_timer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,23 @@ const cacheFunction = cb => {
const renderCache = cacheFunction
const render = num => {
// secondTens
secondTens.innerText = `${num % 10}`
secondTens.innerText =
secondTens.innerText === `${num % 10}`
? secondTens.innerText
: `${num % 10}`
// secondOnes
secondOnes.innerText = `${num % 100}`
secondOnes.innerText =
secondOnes.innerText === `${num % 100}`
? secondOnes.innerText
: `${num % 100}`
// msHundreds
msHundreds.innerText = `${num % 1000}`
msHundreds.innerText =
msHundreds.innerText === `${num % 1000}`
? msHundreds.innerText
: `${num % 1000}`
// msTens
msTens.innerText = `${num % 10000}`
msTens.innerText =
msTens.innerText === `${num % 10000}` ? msTens.innerText : `${num % 10000}`

const timeArr = [secondTens, secondOnes, msHundreds, msTens]
}
Expand Down

0 comments on commit baf7a2a

Please sign in to comment.