A mere comment saying- //this function rolls a dice makes co-pilot understand what we want and it writes the code for us.
The code-
//this function rolls a dice
function rollDice() {
return Math.floor(Math.random() * 6) + 1;
}
For the live video open https://user-images.githubusercontent.com/67784844/140619338-33778342-9b5b-4480-a0ff-d1b1d3eb7ae1.mp4