Setters Help!


#1

I’m doing https://www.codecademy.com/courses/introduction-to-javascript/lessons/advanced-objects/exercises/setters?action=resume_content_item right now and for the setter method I wrote:

set numOfSensors(num) {
    if (typeof num === 'number' && num >= 0) {
      this.numOfSensors = num;
    }
  }

It was marked as wrong. I checked the hint, I wrote exactly what it wanted me to. Why is this? Did I write something wrong after all?


#2

Alright, I copy-pasted what it wanted me to write, and it was accepted. But I wrote the exact same thing! I don’t see any problem.


#3

Oh… I see what happened. I forgot the underscore.