Javascript Primer Quiz - Variables

How do you declare a variable named age with a value of 25?

  1. let age = 25
  2. create age = 25
  3. let age = #25
        let answer
      
        tests({
          'answer is correct': (t) => {
            t.isEqual(answer, 1, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
          }
        })
      

How do you assign a value to a variable?

You have a variable named name which currently has a value of "Alex", and you want to change the value to "Ahmad". Which line of code would you use?

  1. name => "Ahmad"
  2. name is "Ahmad"
  3. name = "Ahmad"
  4. let name = "Ahmad"
        let answer
        
        tests({
          'answer is correct': (t) => {
            t.isEqual(answer, 3, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
          }
        })
    

What is the value of this variable?

After the below code has been run, what is the value of the bird variable?

let bird = "Tui"
bird = "Kiwi"
    
  1. "Tui"
  2. undefined
  3. "Kiwi"
  4. "kiwi"
        let answer
        
        tests({
          'answer is correct': (t) => {
            t.isEqual(answer, 3, `${answer === undefined ? "You haven't submitted an answer yet" : "Not quite, try again"}`)
          }
        })
    

Congratulations!

You've completed the whole quiz!