Dice - ES Modules
✓ Published0🌍 Public
Aangusgrant
Last edited Mar 4, 2023
Created on Mar 4, 2023
This example demonstrates JavaScript ES Modules by simulating dice rolls in the browser console. It imports the `d6` and `d20` functions from a separate `roll.js` module, then logs the results of rolling a six-sided and twenty-sided die. The module defines dice size arrays and uses a Fisher-Yates shuffle algorithm to randomly select a value from each array. The page itself displays only a heading and brief instruction, with all output occurring in the developer console.
AI-generated description