Skip to content

Trying to add 5 years using moment

I am trying to add up to 5 years and each year it adds I am storing it to be displayed later. The output ends up being 2026 for all the outputs. I expecting to be: Answer Try the following: Just re-use the original moment object and modify it each time you want to use it.

How to create user input in the JavaScript console?

I’m creating a short game in the JavaScript console, and for inspiration, I looked at google’s easter egg version (if you search text adventure then press f12 you can see it). I wanted input, the only way I could figure out how to have input was by having functions: But in google’s version, …