[Please Help, I'm Begging You] How do you set up a dictionary or index for values in JS, or, what is the proper term of what I a
I'm pretty sure that I don't know how to word this whenever I try googling it or looking in forums (here & elsewhere). I'm trying to figure out how to set up a dictionary for values, I'll try my best to explain it with the true question at the bottom: For example: Right now I am making a code for testing a deck of playing cards, here's a link: https://code.sololearn.com/WBwCY57kEnLX/#html It is nothing major at ALL since this is my first actual attempt at making some type of code, right now it's just a few arrays and a simple little function to combine a random value from each array together and display it. My end goal with it is to make it possible to play a game of Blackjack, if you don't know already, blackjack works by each card being valued based on the value or rank (2 = 2 points, 3 = 3 points, ...., face cards = 10 points, Ace = either 1 point or 11 points depending on your current hand value). MY PROBLEM/QUESTION: I want my code to understand that if the user draws a FACE card it will be valued at 10, and if it draws an ACE it will be either 1 or 11, and so on for other values. I can sort of guess how to make the code determine if it would need to use the Ace as 1 point or 11 points with an if-else statement, but my real issue is how do I get JS to actually recognize that a face card (J, Q, K) or Ace would have those specific values? This way if the code I currently have displays something like "King of Spades" then it would recognize that the card has a value of 10 points. I feel like this is super simple but no matter what I google and no matter how many walkthroughs I look up of how to make a card deck in JS I can't seem to figure out how something like this works.