Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

How do we access the property of the object without calling object.property?

$
0
0

I'm pretty new to programming in general so this may be a very basic question.

Also English isn't my native language, my appologies if I don't express myself very well.

const questions = [{
      question: "what is 2 + 2 ?",
      answer: [{
        text: "4",
        correct: true
      }];
    ]

function showQuestion(question) {
  questionElement.innerText = question.question
}

I'm having trouble understanding, how do we access the question property of the object questions ("what is 2 + 2 ?") without calling its object.property(questions.question) but instead use parameter.property(question.question)?


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>