Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

105
Views
assistance with coding a comparison statement for my spaceman game

This is part of the code; the function works correctly, however having trouble coding the comparison statement in order to display correct letters on screen

function play() {
    let index = Math.floor(Math.random()* words.length)
    console.log(words[index])
    for(let i = 0; i < words[index].length; i++){
        console.log(words[0][i])
        let div = document.createElement('div')
         div.innerHTML=' - '//words[0][i]
        document.querySelector('.hold-words').append(div)
//This is the section I know is incorrect looking for guidelines 
        if (words[index] === ' - '){
            words.innerHTML === ' - '
            wordSpace = '- '
            
        }
        words.push('- ')
        
        
    }const buttons = document.querySelectorAll('button')
    buttons.forEach(button => button.addEventListener('click', e => {
        console.log(e.target.innerHTML)
    }))
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!