title: Put image inside of array in javascript
body: <p>In this rock-paper-scissors game I'm working on, I want to replace the 'emoji' which is printed and taken from the array called SELECTIONS, and put an image instead of the emoji.</p>
  <p>I already replaced the emojis in the html file with my pngs, but I also want the results to be pngs and not emojis. How do I write in the SELECTIONS array to print an image and not an emoji?</p>
  <p>The code is taken from this tutorial : <a href="https://www.youtube.com/watch?v=1yS-JV4fWqY&amp;t=498s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=1yS-JV4fWqY&amp;t=498s</a></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const selectionButtons = document.querySelectorAll('[data-selection]')
  const finalColumn = document.querySelector('[data-final-column]')
  // const computerScoreSpan = document.querySelector('[data-computer-score]')
  // const yourScoreSpan = document.querySelector('[data-your-score]')
  const SELECTIONS = [
    {
      name: 'rock',
      emoji: '✊',
      beats: 'scissors'
    },
    {
      name: 'paper',
      emoji: '✋',
      beats: 'rock'
    },
    {
      name: 'scissors',
      emoji: '✌',
      beats: 'paper'
    }
  ]
  
  selectionButtons.forEach(selectionButton =&gt; {
    selectionButton.addEventListener('click', e =&gt; {
      const selectionName = selectionButton.dataset.selection
      const selection = SELECTIONS.find(selection =&gt; selection.name === selectionName)
      makeSelection(selection)
    })
  })
  
  function makeSelection(selection) {
    const computerSelection = randomSelection()
    const yourWinner = isWinner(selection, computerSelection)
    const computerWinner = isWinner(computerSelection, selection)
  
    addSelectionResult(computerSelection, computerWinner)
    addSelectionResult(selection, yourWinner)
  
    if (yourWinner) incrementScore(yourScoreSpan)
    if (computerWinner) incrementScore(computerScoreSpan)
  }
  
  function incrementScore(scoreSpan) {
    scoreSpan.innerText = parseInt(scoreSpan.innerText) + 1
  }
  
  function addSelectionResult(selection, winner) {
    const div = document.createElement('div')
    div.innerHTML = selection.emoji
    div.classList.add('result-selection')
    if (winner) div.classList.add('winner')
    finalColumn.after(div)
  }
  
  function isWinner(selection, opponentSelection) {
    return selection.beats === opponentSelection.name
  }
  
  function randomSelection() {
    const randomIndex = Math.floor(Math.random() * SELECTIONS.length)
    return SELECTIONS[randomIndex]
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
    &lt;title&gt; Freeze&lt;/title&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;Document&lt;/title&gt;
    &lt;link rel="stylesheet" href="styles.css"&gt;
    &lt;script src="script.js" defer&gt;&lt;/script&gt;
    &lt;script src="sketch.js" defer&gt;&lt;/script&gt;
    &lt;script src="https://cdn.jsdelivr.net/npm/p5@1.4.0/lib/p5.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div class="selections"&gt;
      &lt;button class="selection" data-selection="rock"&gt;&lt;img src ="rock.png" &lt;/button&gt;
      &lt;button class="selection" data-selection="paper"&gt;&lt;img src="paper.png"&lt;/button&gt;
      &lt;button class="selection" data-selection="scissors"&gt;&lt;img src="scissors.png"&lt;/button&gt;
    &lt;/div&gt;
    &lt;div class="results"&gt;
      &lt;div&gt;
        You
      
      &lt;/div&gt;
      &lt;div data-final-column&gt;
        Computer
  
      &lt;/div&gt;
      &lt;!-- &lt;div class="result-selection winner"&gt;✊&lt;/div&gt;
      &lt;div class="result-selection"&gt;✌&lt;/div&gt; --&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>