I would like to store the value yes into localStorage with a key of movie1 using javascript. However, I want the 1 part of the key to be dynamic based on whatever movieID is set to.
This is what I currently have, but it isn’t working:
movieID = 1;
localStorage.movie + movieID = 'yes';
Any thoughts or insight on how I can accomplish this would be greatly appreciated. Thanks!
Try this: