This recipe shows how to log a random integer between 1 and 6 (representing a roll of a die) in either the node.js or web browser console.
Prints the message You rolled:
followed by a random integer between 1 and 6 to the console.
Prints the message You rolled:
followed by a random integer between 1 and 6 to the console when the page is loaded.
Make sure to open the console with dev tools first, then reload/refresh the page.