These are chat archives for FreeCodeCamp/Help

1st
Jan 2015
Christopher Hutchinson
@cshutchinson
Jan 01 2015 00:23
@iheartkode what drives av on freecodecamp.com? I can't find a place to set it on fcc, but gravatar.com and gitter are working fine
does anyone have the fcc stats link again or where to find it?
Quincy Larson
@QuincyLarson
Jan 01 2015 00:25
Christopher Hutchinson
@cshutchinson
Jan 01 2015 00:25
ty quincy
Quincy Larson
@QuincyLarson
Jan 01 2015 00:26
@cshutchinson As far as images, we pull them in from Single Sign On providers. Facebook, Google and LinkedIn all have their own images. Github uses Gravatar I think
Christopher Hutchinson
@cshutchinson
Jan 01 2015 00:26
thank you will work on those
happy new year!
Quincy Larson
@QuincyLarson
Jan 01 2015 00:27
@cshutchinson Happy new year!
Suzanne Atkinson
@AdventureBear
Jan 01 2015 06:42
var friends = new Object();

friends.bill = new Object();
friends.steve = new Object();

bill.firstName = "Bill";
bill.lastName = "Gates"; 
bill.number = "4128181122";
Ryan Malm
@Rybar
Jan 01 2015 06:43
did you have a question @AdventureBear ?
Suzanne Atkinson
@AdventureBear
Jan 01 2015 06:44
Happy new year and is there anything wrong with that code? the codecademy editor is telling me that "bill is not defined"
Ryan Malm
@Rybar
Jan 01 2015 06:44
This message was deleted
var friends = new Object();

friends.bill = new Object();
friends.steve = new Object();

friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates"; 
friends.bill.number = "4128181122";
you initialized bill and steve as objects within the friends object, so to add properties to any of them, you have to start with friends
Suzanne Atkinson
@AdventureBear
Jan 01 2015 06:55
oh., I guess that makes sense.
var friends = {
    bill: {},
    steve: {}
};
Justin Rogers
@yaskyj
Jan 01 2015 06:57
You can also create it with a function.
function Friends  () {}
bill = new Friends();
bill.firstName = "Bill";
Suzanne Atkinson
@AdventureBear
Jan 01 2015 06:58
this is the other notation for the cahallenge ^^
if I used the other one I posted, would i still ahve to use friends.bill.firstName?
the different ways to create new objects are confusing, b/c the syntax looks different to me
it seem slike they behave differently
Ryan Malm
@Rybar
Jan 01 2015 06:58
and really you'd never use new Object() practically
Suzanne Atkinson
@AdventureBear
Jan 01 2015 06:59
I thought you had to tok make anew object...it can be any name?
codecademy is falling short in this one !
Ryan Malm
@Rybar
Jan 01 2015 06:59
but good to know whats possible I guess.
var Friends = {}
also initializes an object
Suzanne Atkinson
@AdventureBear
Jan 01 2015 07:00
ok thats easier. I thought you had to use the word "Object" for some reason.
thanks
Ryan Malm
@Rybar
Jan 01 2015 07:01
@yaskyj that function wouldn't work as-is, it's calling itself recursively
Justin Rogers
@yaskyj
Jan 01 2015 07:02
What I posted?
Ryan Malm
@Rybar
Jan 01 2015 07:02
nevermind. I missed the {}
Kathy O'Driscoll
@odrisck
Jan 01 2015 07:03
var myObject, where myObject is the name of your object, ie, friends, is an object literal
``` var Friends = {}
Ryan Malm
@Rybar
Jan 01 2015 07:04
but it still wouldnt be correct, Friends is meant to be a container for other people (bill)
Kathy O'Driscoll
@odrisck
Jan 01 2015 07:04
heh hates me
right
can you create an object within an object? I can’t remember how we did it for that lesson, going back to it now
Ryan Malm
@Rybar
Jan 01 2015 07:06
certainly. functions are objects.
Kathy O'Driscoll
@odrisck
Jan 01 2015 07:06
so what I did was var friends = {};
friends.bill={
Ryan Malm
@Rybar
Jan 01 2015 07:07
which is right, object literal notation, like you said
Kathy O'Driscoll
@odrisck
Jan 01 2015 07:07
then the values of firstName: “Bill”;
and so forth
then friends.steve = {
thank you, sorry for interjecting, I thought I forgot, but I hadn’t :), JS noob still :)
Suzanne Atkinson
@AdventureBear
Jan 01 2015 07:46
so you set all the values inside the {} for friends.bill
I feel like they left out an important step, lol.
Kathy O'Driscoll
@odrisck
Jan 01 2015 07:52
right, so friends.bill is an object of Friends
Suzanne Atkinson
@AdventureBear
Jan 01 2015 12:49
Happy new year!
Help wanted...
var list = function(friends){
for (var name in friends) {
  console.log (friends[name]); 
}

};

list(friends);
Nathan
@terakilobyte
Jan 01 2015 12:50
what does friends look like?
Suzanne Atkinson
@AdventureBear
Jan 01 2015 12:50
this isn't working to print out "bill" and "steve". Continuation of the code above
var friends = new Object();

friends.bill = new Object();
friends.steve = new Object();

friends.bill.firstName = "Bill";
friends.bill.lastName = "Gates"; 
friends.bill.number = "4128181122";
friends.bill.address = ["16 Telegraph Way", 
"redmond", "WA", "98052"];

friends.steve.firstName = "Steve";
friends.steve.lastName = "Jobs"; 
friends.steve.number = "4129391122";
friends.steve.address = ["123 East Court St.", "New York", "NY", "12435"] ;

var list = function(friends){
for (var name in friends) {
  console.log (friends[name]); 
}

};

list(friends);
Nathan
@terakilobyte
Jan 01 2015 12:51
ah
what is name representing?
Suzanne Atkinson
@AdventureBear
Jan 01 2015 12:51
that's the whole thing. this is the "write a function that prints out "bill" and "steve" " challenge, or just the name key of frineds.
friends
I don' t know! First I used "i" but that didn't work. So I used the name of the key to see if that worked, thinking it might be semantic.
haha...it's not even a key is it?
Geez, I'm tired.
Nathan
@terakilobyte
Jan 01 2015 12:52
try console.log(friends[name.firstName])
Suzanne Atkinson
@AdventureBear
Jan 01 2015 12:54
when I do this: console.log (name);
it prints out bill steve bill steve
goes through twice
hmm, changed "name" to "i" and now it works as expected. Just not as I expected, lol
i guess that names sense, it's printing the name of the 2 objects in friends and not printing the firstName key
Suzanne Atkinson
@AdventureBear
Jan 01 2015 13:05
OK, i got it to work with some understanding of the code. Guess what? Time to board!!
I'm doing 2 codecademy challenge steps per half day at this rate.
Nathan
@terakilobyte
Jan 01 2015 13:06
lol
have fun!
Suzanne Atkinson
@AdventureBear
Jan 01 2015 13:07
I"m also at 27 challenges in FCC, trying to climb the "stats" ranks for the group
Nathan
@terakilobyte
Jan 01 2015 13:10
I deleted my account several times over in testing the authentication with @QuincyLarson :)
so I’m at 0 challenges complete!
Quincy Larson
@QuincyLarson
Jan 01 2015 17:30
@AdventureBear but @terakilobyte helped solve the bug (or so we think)
Mark Howard
@iheartkode
Jan 01 2015 17:38
@terakilobyte you could always use incognito mode :)
Nathan
@terakilobyte
Jan 01 2015 22:03
@iheartkode to test the sign in functionality? Unfortunately I had linked all my social accounts
Mark Howard
@iheartkode
Jan 01 2015 22:30
Ahh
Nathan
@terakilobyte
Jan 01 2015 22:31
yeah
oh well
:)
Mark Howard
@iheartkode
Jan 01 2015 22:31
Bummer
Nathan
@terakilobyte
Jan 01 2015 22:32
it’s alright. I also discovered that @QuincyLarson has deleted his account several times over in testing too
Mark Howard
@iheartkode
Jan 01 2015 22:32
lol