Skip to content

Challenge "Make Object Properties Private" re-introduction(?) of "this" needs link back to where we used it before #7282

Closed
theoneinskane opened this Issue · 6 comments

2 participants

@theoneinskane

The use of the this keyword to determine a public versus a private property in an object came quite some challenges ago, it would be very useful to insert the link back to the previous challenge when it was introduced first for reference. If I knew a bit more about github and git I would try to pull it down and add it myself.

Challenge Make Object Properties Private has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/601.4.4 (KHTML, like Gecko) Version/9.0.3 Safari/601.4.4.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

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 = 4;

  this.setGear = function (newGear){
    gear = newGear;
  };

  this.getGear = function() {
    return gear;
  };


};

var myCar = new Car();

var myBike = new Bike();
@raisedadead
Free Code Camp member

@theoneinskane Can you point me to the challenge where we used this first. Also I feel we should add a link to the official MDN documentation.

@theoneinskane

@raisedadead yes! It is: make-instances-of-objects-with-a-constructor-function challenge. I agree link to MDN would be very useful.

@theoneinskane

@raisedadead when it gets the help wanted, does it mean we need some help to do the changes. I would love to try to do the update myself but I am still quite new and not sure how to do everything.

@raisedadead
Free Code Camp member

@theoneinskane You should definitely start by contributing to this one.
I understand that you are not very familiar with git and github, please check this tutorial. This will get you started.

For contributing to this repo you need to go through the contributing guidelines

That's it.

And yup if you are stuck there is a dedicated help chat room for contributors, ping us there!

Goodluck!

@raisedadead raisedadead removed the Discussing label
@theoneinskane

@raisedadead I haven't got the backend part yet and having just spent an hour trying to get node and mongoldb setup on my macbook without being able to get the node mongoldb drivers to install, I am not sure I will get to fixing this any time soon.

@raisedadead
Free Code Camp member

@theoneinskane No worries! Hope to see ya working on others if this one is taken by that time.

@raisedadead raisedadead added the easy label
@kalunlee136 kalunlee136 added a commit to kalunlee136/FreeCodeCamp that referenced this issue
@kalunlee136 kalunlee136 added links for clarification on Make Objects Properties Private chal…
…lenge.

adding links to documentation/previous challenge introducing the 'this' keyword for clarification. This closes #7282.
25c66cf
@kalunlee136 kalunlee136 added a commit to kalunlee136/FreeCodeCamp that referenced this issue
@kalunlee136 kalunlee136 added links for clarification on Make Objects Properties Private chal…
…lenge.

fixed grammar from previous PR. This closes #7282.
d021574
@raisedadead raisedadead closed this in #7620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.