This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (user1.choice !== 'no choice' && user2.choice !== 'no choice') { | |
if (user1.choice === user2.choice) { | |
updatedRoom = await room.update({ | |
status: 'game is over', | |
winner: `oh, it's a tie!`, | |
}); | |
} else { | |
if (user1.choice === ROCK) { | |
if (user2.choice === SCISSORS) { | |
updatedRoom = await room.update({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myDetails = { | |
name: 'Simona', | |
hobbies: ['reading', 'sleeping'], | |
cats: ['Fetti', 'Diego'], | |
loves: 'Robots' | |
}; | |
// add key/value pairs to your localStorage | |
// to store JS objects you need to serialise them first | |
localStorage.setItem('details', JSON.stringify(myDetails)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test |