var favoritemovie = "Shrek"; sessionStorage.setItem("favoriteMovie", favoritemovie);
Here is what the above code is Doing:
1. We create a variable called favoritemovie and set it equal to the string “Shrek”.
2. We then use the setItem() method to create a key called “favoriteMovie” and set its value to the string “Shrek”.