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
CamperBot
@camperbot
Sorry, can't find a bonfire called lookups. [ Check the map? ]
Emanuel Quimper
@EQuimper
bf Using Objects for Lookups
CamperBot
@camperbot
Sorry, can't find a bonfire called using objects for lookups. [ Check the map? ]
Ari Winokur
@ariwinokur
its a challenge, not a bonfire
Norman Dela Cruz
@dcnr
@ariwinokur simplified explanation
var foo = {
  bar: "baz"
}
  1. Dot with literal property name
    var result = foo.bar;  //  result is baz
  2. Bracket with literal property name
    var result = foo["bar"]; // result is baz
  3. Bracket with variable property name
    var myProp = "bar";
    var result = foo[myProp]; // result is baz
Emanuel Quimper
@EQuimper
yes I see
hellotojello
@hellotojello
function repeat(str, num) {
  var stringLayout = console.log(str);
  if (num >= 0){
    return stringLayout * num;
  }
  // repeat after me
else{
  return "";
}
  }

repeat("abc", 3);
i need a hint
Emanuel Quimper
@EQuimper
@ariwinokur just reed the example all you need his here
@ariwinokur tips when you gonna return you need to put [val]
Prithvi-A
@Prithvi-A
This message was deleted
What is wrong with my code

var Car = function(wheels, seats, engines) {
//Change this constructor
this.wheels = 6;
this.seats = 3;
this.engines = 4;
};

//Try it out here
var myCar = new Car(4, 2, 2);

Emanuel Quimper
@EQuimper
@Prithvi-A put your code into ``` plz
Prithvi-A
@Prithvi-A
var Car = function(wheels, seats, engines) {
  //Change this constructor
  this.wheels = 6;
  this.seats = 3;
  this.engines = 4;
};

//Try it out here
var myCar = new Car(4, 2, 2);
Norman Dela Cruz
@dcnr
@Prithvi-A you can edit your post by clicking the ... right of the timestamp, so you don't have to repost
Prithvi-A
@Prithvi-A
fixed that
Norman Dela Cruz
@dcnr
what exercise is that anyway
Ari Winokur
@ariwinokur
@dcnr: so lookup is not actually used
^^^meaning the word lookup in the code
Norman Dela Cruz
@dcnr
@ariwinokur well unless you make a variable named lookup I guess :P
Prithvi-A
@Prithvi-A
Make Unique Objects by Passing Parameters to our Constructor
Emanuel Quimper
@EQuimper
@Prithvi-A you nee to pass your argument into each of variables cause now what you passign is 4 6 2 3 2 4
Ari Winokur
@ariwinokur
Well put @dcnr
Emanuel Quimper
@EQuimper
@Prithvi-A example this.wheels = wheels
etc
Norman Dela Cruz
@dcnr
@Prithvi-A you'll need to modify the car constructor function like what @EQuimper said :point_up: February 16, 2016 9:22 AM
Tom Hodgkinson
@LibLogic
Anybody here good at recursive functions?
Ari Winokur
@ariwinokur
@dcnr how would that work in my challenge? http://www.freecodecamp.com/challenges/using-objects-for-lookups
Norman Dela Cruz
@dcnr
@ariwinokur read and understand the directions carefully, it's practically laid out for you :P
Alex N.
@N0bl3
@LibLogic send your code, i like these problems :)
Tom Hodgkinson
@LibLogic
@N0bl3 thanks
CamperBot
@camperbot
liblogic sends brownie points to @n0bl3 :sparkles: :thumbsup: :sparkles:
:star: 157 | @n0bl3 | http://www.freecodecamp.com/n0bl3
Tom Hodgkinson
@LibLogic
send it in private?
Emanuel Quimper
@EQuimper
sry @LibLogic wasn't in this right now still just start
Alex N.
@N0bl3
@LibLogic send it here , with before it and after it
Emanuel Quimper
@EQuimper
@LibLogic that's why I don't answer
Tom Hodgkinson
@LibLogic
This message was deleted
var fibs = [0, 1];
function sumFibs(num) {
    if ( num === 0 ) { return }
    fibs.push(fibs[fibs.length - 2] + fibs[fibs.length - 1]);
        var fibTotals = fibs.filter(function (el) {
            if (el % 2 !== 0) {
                return true
            }
        }).reduce(function (all, item) {
            all += item;
            return all;
        });
    console.log(fibTotals);
    sumFibs(num-1);
}

console.log(sumFibs(9));
I appreciate your help guys...hate to give up on this
Alex N.
@N0bl3
@LibLogic Let's continue here :)
Ari Winokur
@ariwinokur
@dcnr I got it finally, but the explanation was really lacking!
Alex N.
@N0bl3
@LibLogic the problem is the way you organize your code with return statements. return breaks the sumFibs() in a way that having fibTotals variable doesn't make sense
@LibLogic to put you on the tracks, you should reorganize everything and do something like return sumFibs(num-1)
i know i always give the docs to read but these are a great way to imrove as even professionals may find new things there
Tom Hodgkinson
@LibLogic
ok I will try reading up
Alex N.
@N0bl3
in short: docs are LIFE :+1:
Tom Hodgkinson
@LibLogic
I thought I understood return though..lol