I need to create a little game simulator, but for that i need to consume a JSON file i have in my computer. The JSON is like a deck of cards and i need to put those cards into a player hand (array), but i'm looking everywhere and i don't get how i can consume the JSON file and insert it into my array.
I got here so far, but it does not work. Can someone aliviate my headache? I've been searching for ages, and i can only find people reliably people using Jquery, babel or typescript to consume it.
<script type="module">
import * as data from './rounds.json';
let arrayJoao = new Array(5);
let arrayMaria = new Array(5);
let roundsJogo = JSON.parse(data);
console.log(roundsJogo[0]);
</script>