Why this function gave me the undefined in javascript?

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())

146 thoughts on “Why this function gave me the undefined in javascript?”

  1. Pingback: keto diet exercise
  2. I do accept as true with all the ideas you’ve offered to your post.

    They are really convincing and will definitely work.

    Nonetheless, the posts are too brief for novices. Could you please prolong them a bit from subsequent time?
    Thanks for the post.

    Reply
  3. Howdy I am so thrilled I found your webpage, I really found you by error, while I was browsing
    on Google for something else, Anyhow I am
    here now and would just like to say thank you for a remarkable post and a
    all round exciting blog (I also love the theme/design), I don’t have time to read it all at the moment but I have saved it
    and also included your RSS feeds, so when I have time I will be back to read
    more, Please do keep up the great work.

    Reply
  4. Hello! I could have sworn I’ve visited your blog before but after browsing through many of the
    articles I realized it’s new to me. Regardless, I’m definitely happy I came across it and I’ll be bookmarking
    it and checking back frequently!

    Reply
  5. Hi! I know this is kinda off topic however I’d figured
    I’d ask. Would you be interested in trading links or maybe guest authoring a blog
    post or vice-versa? My website discusses a lot of the same subjects as yours
    and I feel we could greatly benefit from each other. If you might
    be interested feel free to send me an email. I look forward to hearing
    from you! Excellent blog by the way!

    Reply
  6. I blog frequently and I seriously appreciate your content.
    This article has truly peaked my interest. I am going to bookmark your site and keep checking for new information about once a week.
    I subscribed to your Feed too.

    Reply