Closure does not work

Closure does not work
0

#1

Tell us what’s happening:

Every item seems correct but it does not work! Why??
Thank you in advance.

Your code so far


function Bird() {
  let weight=10;

  this.getWeight = function(){
    return weight;
   };
  }

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/use-closure-to-protect-properties-within-an-object-from-being-modified-externally


#2

The original code has weight as 15.

function Bird() {
  this.weight = 15;
  
  
}

Try changing your value to 15.