Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Moisés Man
@moigithub
some1 had a name with "danke" on it.. he got free brownies too
Ian Gracia
@iangracia
im looking at it on challenge 347, "Record Collection"
@piteto
Jorge
@flawedLogic506
cbot
CamperBot
@camperbot
you called?
piteto
@piteto
That black box on the freecodecamp challenges isn't a valid console
Jorge
@flawedLogic506
learn spanish
Moisés Man
@moigithub
:P
Ian Gracia
@iangracia
how can i pass the challenge then :cry:
piteto
@piteto
it only outputs the results of the tests they run against your code - with the more complicated challenges, you need to use an environment with an actual developer console. codepen, repl.it, or your own local environment
It helps a lot with the debugging
Ian Gracia
@iangracia
ok, then when im finished i can just paste the code and pass the challenge?
piteto
@piteto
Yes, exactly
Ian Gracia
@iangracia
i mean, maybe i need to access something with the method im using right now
maybe it wont work then either
but alright, ill finish the challenge on codepen
i get the feeling that fcc black box have betrayed me in the past and i thought it was something wrong with my code
piteto
@piteto

It looks like there are some conditions to consider to pass that challenge

If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property.

I hit the same problem as you when I started the challenges - surprised you made it to the advanced algorithms without using an actual coding environment
I applaud your perseverance :p
Ian Gracia
@iangracia
haha yeah.. the secret is to rage quit every once and then and take a break from coding for a couple of weeks and tell yourself you suck at coding, then come back more motivated than ever
piteto
@piteto
Great advice !
Ian Gracia
@iangracia
Hey, what is "" equal to?
nvm
Kaz Baig
@kbaig
Hey folks, would appreciate some feedback on my Game of Life so far https://codepen.io/kbaig/full/wrqbNb/
Markus Kiili
@Masd925
@iangracia Equal can mean many things.
CamperBot
@camperbot
masd925 sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 348 | @iangracia |http://www.freecodecamp.com/iangracia
Nickey Pickorita
@Pickorita
Hi, anyone online?
Ian Gracia
@iangracia
yeah
i also want to live in london
Nickey Pickorita
@Pickorita
@iangracia then move to london lol :D
CamperBot
@camperbot
pickorita sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 349 | @iangracia |http://www.freecodecamp.com/iangracia
Nickey Pickorita
@Pickorita
btw could anyone pm me please, I need quick help with CSS
Zerka1982
@Zerka1982
put your code in codepen
piteto
@piteto
Feel free to ask your question here @Pickorita plenty willing to help. If it's a lot of code, put it in a codepen or jsfiddle
Nickey Pickorita
@Pickorita
I can't put it in codepen
its quite large and in dreamweaver
There are just 3 elements that I need to align but I think I messed up something so its just aligning wrongly
anyone willing to check screenshots?
Ian Gracia
@iangracia
var collection = {
    "2548": {
      "album": "Slippery When Wet",
      "artist": "Bon Jovi",
      "tracks": [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    "2468": {
      "album": "1999",
      "artist": "Prince",
      "tracks": [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    "1245": {
      "artist": "Robert Palmer",
      "tracks": [ ]
    },
    "5439": {
      "album": "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) { 
  if (value=="") {
    delete collection[id][prop];
    return collection;
  }
  switch(prop) {
    case "tracks":
      if (collection.hasOwnProperty(prop)) {
        collection[id][prop].push(value);
      }
      else {collection[id][prop]= [value];}
      break;     
    default:
      collection[id][prop] = value;      
             }

  return collection.hasOwnProperty(prop);
}

// Alter values below to test your code
console.log(updateRecords(2468, "tracks", "Free"));
guys why is it returning false
when it obv should return true because 2468 has a property called tracks
no need to look at the whole code, just tell me why the returned boolean is false
Justine Diza
@JustineDiza
Hi! Does anyone here use UI Router? I have a problem with my code, been trying to find other solutions for about an hour now, help is pretty much appreciated!
wnghero
@wnghero
@iangracia heres how I did that problem
CamperBot
@camperbot
wnghero sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 350 | @iangracia |http://www.freecodecamp.com/iangracia
wnghero
@wnghero
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [ 
        "Let It Rock", 
        "You Give Love a Bad Name" 
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [ 
        "1999", 
        "Little Red Corvette" 
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line
function updateRecords(id, prop, value) {
  if(value !== "" && prop !== "tracks"){
    collection[id][prop] = value;
  }  else if(prop=="tracks"&&value!==""&&collection[id][prop]===undefined){
    collection[id][prop] = [];
    collection[id][prop].push(value);
  } else if(prop=="tracks"&&value!==""){
    collection[id][prop].push(value);
  } else if(value===""){
    delete collection[id][prop];
  }

  return collection;
}

// Alter values below to test your code
updateRecords(5439, "tracks", "Take a Chance on Me");