Skip to content

Category: Questions

How to handle the change of the previous object

I’m currently making a nav bar. I create an array storing the info of the tabs in the nav bar. When a new route is clicked it updates the newly clicked tab to allow the current property to be true. How would you change the previous nav item to false. As currently they all change to true one by one

Getting Javascript to accept button clicks

I am writing a program that is similar to an Etch-A-Sketch where moving the cursor over a block turns it from black to a random color. I want the user to be able to hold down the spacebar and the program will stop highlighting blocks, which will let the user move their cursor without messing up their drawing.…