I have following code
const integerDivide = (a, b) => {
  return [Math.floor(a / b), a % b]
}
let sec = 555003,
  min, hr, day;
[min, sec] = integerDivide(sec, 60)
console.log(`sec: ${sec}`)
console.log(`min: ${min}`)
[hr, min] = integerDivide(min, 60)
console.log(`hr: ${hr}`)This code is giving following error
Uncaught TypeError: Cannot set property '9250' of undefined
I don't understand why this code don't work. Any explanation or correction will be appreciated. Below is the code pen link https://codepen.io/devbkhadka/pen/ExyyEWE?editors=1111
 
     
    