I am newbie to the javascript and I wrote the simple function below. I am wonder that the function blow gave me the undefined. Is there any mistake in the function below?
function randFace() {
return ["crown", "anchor", "heart", "spade", "club", "diamond"]
[rand(0, 5)];
}
console.log(randFace())