Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • May 10 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 17:12
    @mstellaluna banned @cmal
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:11
    thecodingaviator labeled #31179
  • Apr 01 18:09
    thecodingaviator commented #31179
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:09
    thecodingaviator labeled #31182
  • Apr 01 18:07
    thecodingaviator commented #31182
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator labeled #31190
  • Apr 01 18:07
    thecodingaviator commented #31190
  • Apr 01 18:05
    thecodingaviator commented #31157
  • Apr 01 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 18:04
    thecodingaviator closed #31157
  • Apr 01 18:04
    thecodingaviator closed #33788
  • Apr 01 18:04
    thecodingaviator commented #33788
  • Apr 01 18:02
    thecodingaviator closed #31059
  • Apr 01 18:02
    thecodingaviator commented #31059
Frank
@fctromba66
I am stuck on the make object properties private I cannot figure out where to put the myBike.getGear()

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

this.getGear = function(change){
gear += change;
};

this.setGear = function(){
gear +=1;
};
};

var myCar = new Car();

var myBike = new Bike();

Norman Dela Cruz
@dcnr
@azat55 read the description at the side carefully, it shows an example of a "lookup table"
Iván Muñiz Rivera
@Pilotwing
@dcnr ok that part i got it clear know. So my next thing to fix will be the expression
Nikki
@nikkiLuan
@fctromba66 we are same, i'm working on it now
Iván Muñiz Rivera
@Pilotwing
@dcnr mI am getting red dots in the spaces so I guess my code is adding to the unicode values of the white spaces
Norman Dela Cruz
@dcnr
@Pilotwing also I just noticed that your ternary operator isn't probably working
Frank
@fctromba66
@nikkiLuan I think it goes underneath the var myBike = new Bike(); but I am stuck
matthew3454
@matthew3454
Can someone help me with the exercise Make Object Properties Private. пожалуйста?
Iván Muñiz Rivera
@Pilotwing
@dcnr what is my temproal operator? and sorry to ask
Nikki
@nikkiLuan
var Bike = function() {

  // Only change code below this line.
  var gear = 0;

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

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

};

var myCar = new Car();

var myBike = new Bike();
  myBike.setGear(4);
  myBike.getGear();
Norman Dela Cruz
@dcnr
@Pilotwing I think you should probably use /\W/.test(str[i]) instead of str[i] != /\W/
Nikki
@nikkiLuan
Finally
Norman Dela Cruz
@dcnr
coz regex doesn't work that way
Frank
@fctromba66
@nikkiLuan Nice I was just writing that!!!!
Nikki
@nikkiLuan
@fctromba66 lol
Iván Muñiz Rivera
@Pilotwing
@dcnr oo ok let me try that and also fix the adding and substracting and 'll let you know if I pass the challenge
Norman Dela Cruz
@dcnr
@Pilotwing the conditional operator aka ternary is that ? : part you're using, how come you don't know the name :P
bitgrower
@bitgrower

well ... I just ran the solution of symmetric difference provided in the wiki ... and it doesn't work!
(it seems to leave duplicated numbers in the answer, as well as having the order of the numbers in the last test case different, and so doesn't pass ... )

leaves me with a few questions about the meaning of symmetric difference !!!

Iván Muñiz Rivera
@Pilotwing
@dcnr Thanks for reminding me the name XD
CamperBot
@camperbot
pilotwing sends brownie points to @dcnr :sparkles: :thumbsup: :sparkles:
:star: 548 | @dcnr | http://www.freecodecamp.com/dcnr
Jon
@jcmockbee
I would like to post my code how to please
bitgrower
@bitgrower
explain format
CamperBot
@camperbot

:point_right: code formatting [wiki]

Inline code

This an inline `<paste code here>` code formatting with a single backtick(`) at start and end around the code.

Code Block

```js ⇦ Type 3 backticks and then press [shift + enter ⏎] (type js or html or css)

<paste your code here>,
then press [shift + enter ⏎]

``` ⇦ Type 3 backticks, then press [enter ⏎]

See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics

:pencil: read more about code formatting on the FCC Wiki

Jon
@jcmockbee
using snipping tool
Norman Dela Cruz
@dcnr
@bitgrower I think some of the wiki answers are outdated because the exercises are changing too
rphares
@rphares
@jcmockbee , pasting is far preferable than images,
we can't copy and run your code if its a screen shot,
bitgrower
@bitgrower
okay ... it seems to get really close to the answers except for the instances I've noted ... and, uh, I ran your solution and it passes ... :)
rphares
@rphares
nor comment to help
Jon
@jcmockbee
ok will paste then
bitgrower
@bitgrower
so ... my scalp is getting sore from scratching my head ... LOL ...
rphares
@rphares
:point_up: February 9, 2016 10:05 AM @jcmockbee :)
Norman Dela Cruz
@dcnr
@bitgrower you ran mine? :P my solutions aren't exactly friendly because I use newly implemented stuffs and try to shorthand a lot
bitgrower
@bitgrower
yeah, I didn't understand your solution, for sure ...
but it passed!
Norman Dela Cruz
@dcnr
course it does! :D
bitgrower
@bitgrower
I was just trying to figure out what is going on, in terms of answers, solutions, wiki, problem, etc ...
but I was not ready to go digging into fat arrows (I think you used?) thankyouverymuch ... :)
Norman Dela Cruz
@dcnr
oh arrow functions, they're awesome!
@bitgrower I think you just have to hmm write down first what you understood of the description
and what's needed
bitgrower
@bitgrower
tryin' to figure out where the discrepancy is ... the different solutions on stackexchange also seem to not be completely consistent with the solutions in the test cases (they seem to be okay with dup numbers...) ... and finding a good def of sym difference (like, does the order the numbers are returned matter ?)
Yeah, I wrote some code which worked for the first test case ... then couldn't figure out how to pull .reduce into the problem ...
Norman Dela Cruz
@dcnr
ah yeah there's that too, though I remember some exercises where you need to keep the position
bitgrower
@bitgrower
...the solution def had some new syntaxes for me to explore ... like just .concat -- without the arr in front of it ...
kinda making my brain go wonky ...
LOL ... I'll get to arrow functions when I'm ready, right now that would be a bit of overwhelm, I'm afraid ...
Norman Dela Cruz
@dcnr
@bitgrower sorry I lost my original repo, I kept my 'noobie' solutions then, and I think it would have been much better help than the current ones