Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object with key as individual choice and values as the second choice

let choicesObject = {
  'rock' : {
    'rock' : 'draw',
    'scissor' : 'win',
    'paper' : 'lose'
  },
  'scissor' : {
    'rock' : 'lose',
    'scissor' : 'draw',
    'paper' : 'win'
  },
  'paper' : {
    'rock' : 'win',
    'scissor' : 'lose',
    'paper' : 'draw'
  }
}
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #object #key #individual #choice #values #choice
ADD COMMENT
Topic
Name
4+3 =