1
I would like to know how to obtain the values of the variables nipeSorteado
and faceSorteada
to compare with displayed output. The output of row 9 will display the values corresponding to the arrays
. And I would like to know the random values that were generated before entering the index of the array.
//arrays que armazenam os nipes e os numeros das cartas
var nipes = ['♥', '♦', '♣', '♠'];
var faces = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'];
//sorteando valores para os nipes e para as cartas
var nipeSorteado = nipes[Math.floor(Math.random() * 4)];
var faceSorteada = faces[Math.floor(Math.random() * faces.length)];
document.write("<h1>" + faceSorteada + nipeSorteado + "</h1>");
Add code in non-image text format to make it easier for someone to help you.
– sant0will
I already entered the code, vlw by the tip.
– fernando farias