Make Object Properties Private, help needed

var Car = function() {
  // this is a private variable
  var speed = 10;

  // these are public methods
  this.accelerate = function(change) {
    speed += change;
  };

  this.decelerate = function() {
    speed -= 5;
  };

  this.getSpeed = function() {
    return speed;
  };
};

var Bike = function() {

  // Only change code below this line.
  var gear= 5;
  
  this.getGear = function(){
    return gear;
  };
  this.setGear = function(changeGear){
    gear=changeGear;
    
  };
};
var myCar = new Car();

var myBike = new Bike();

What im wondering is how do i actually change the “gear” or “speed” ? I was googling like crazy and cant figure it out

This works.

var Bike = function() {

  // Only change code below this line.
  var gear = 5;
  
  this.getGear = function(){
    return gear;
  };
  
  this.setGear = function(changeGear){
    gear = changeGear;
    
  };
};

var myBike = new Bike();

console.log(myBike.getGear()); // Outputs 5
console.log(myBike.setGear(10)); // Sets gear to 10
console.log(myBike.getGear()); // Outputs 10