Skip to content

Category: Questions

IsNaN shows other results

console output My IsNaN says “12ab” is a number but at the first Non-Number argument its the first non-number, i used the isNaN function twice so idk why it doesnt work Answer You’re not comparing the same values here: the first check (saveNumbers) tests isNaN(parseInt(“12ab”)) w…

Increasing a progress bar by clicking a button

The idea is that the progress bar should increase when you click the button, for example, if you click on the button play the happiness should increase. Answer There are many issues and typos in your code. Clean programming will solve them all. You want a bar for which HTML has a specific tag for: <progres…

Date.getTime() in Next.js returns weird numbers

I am trying to make a page transition in Next.js. As the transition is slower than the page load, I need to calculate the missing time for the animation to finish. The transition should last at least 2 seconds, 1s for a fade in of the loading screen, 500ms so that the loading screen stays a little, and 500ms …