A novice programmer wrote a code that counts the difference between two events and adds a year to the resulting expression in milliseconds. But the fluffy cat ran over the keyboard and messed up the code! Help to restore the code so that it works without errors and displays the received time in days in the console (broken lines are marked with !?).
Date
Mixed everything up
Report a typo
Write a program in JavaScript
let firstEventDate = new Date("2011-01-11")
let secondEventDate = Date("2023-04-26") //!?
let differenceWithSum = secondEventDate - firstEventDate + 3600 * 24 * 365 * //!?
console.log(differenceWithSum / 1000 / 3600 / 24)
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.