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
Joe O.
@joffenhauser
return state,ends are only valid inside functions
statements
Diego Mayer
@Chrono79
@joffenhauser
function abTest(a, b) { // not this one, this one keep it
  // Only change code below this line
    if (a < 0) { 
    return undefined;
}  
  if (b < 0) {
    return undefined;
  }
} //delete this too
function abTest(a, b) { //this one should be DELETED
Joe O.
@joffenhauser
if i leave it in there the console log comes back saying null
Diego Mayer
@Chrono79
do you see the repeated line?
Joe O.
@joffenhauser
yeah, the thing is if i don’t have it in there I get “return statements are only valid inside functions"
I just copied your code, including the repeated line in there and it somehow worked
I feel like the program had a bug or something possibly
Diego Mayer
@Chrono79
@joffenhauser you're closing the function
replace the block in my previous post with this one:
function abTest(a, b) { 
  // Only change code below this line
    if (a < 0 || b < 0) { 
      return undefined;
    }
Ankur
@ankur01oct
stuck with random quote...need help...JSON random quote api gives .... net::ERR_INSECURE_RESPONSE(using chrome browser)
Joe O.
@joffenhauser
ok. like i said, the other code I was using just worked to pass the challenge though... @Chrono79
humansAreDum
@humansAreDum
@ankur01oct post your code here or link to your codepen
Joe O.
@joffenhauser
are you saying the other code was wrong? @Chrono79 Im just a little confused haha
Diego Mayer
@Chrono79
@joffenhauser but it isn't the right code, you're redeclaring the function
Your code should be like this:
// Setup
function abTest(a, b) {
  // Only change code below this line

  if (a < 0 || b < 0) return undefined;

  // Only change code above this line

  return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}
Ankur
@ankur01oct
Joe O.
@joffenhauser
oook, I see exactly how it was supposed to work now @Chrono79
Diego Mayer
@Chrono79
good
Joe O.
@joffenhauser
just went back to the code I pasted initially and saw how it was different from yours
really appreciate the help, thank you
@Chrono79
Diego Mayer
@Chrono79
no problem
humansAreDum
@humansAreDum
you got to help my friend with this. someone plz
you will get 2 brownies
Diego Mayer
@Chrono79
Ankur
@ankur01oct
@Chrono79 @humansAreDum .. thanks
CamperBot
@camperbot
:cookie: 7 | @humansaredum |http://www.freecodecamp.com/humansaredum
ankur01oct sends brownie points to @chrono79 and @humansaredum :sparkles: :thumbsup: :sparkles:
:star2: 1234 | @chrono79 |http://www.freecodecamp.com/chrono79
shilpi verma
@shilpiverma509
@ranaamritparth thanks
CamperBot
@camperbot
shilpiverma509 sends brownie points to @ranaamritparth :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @ranaamritparth |http://www.freecodecamp.com/ranaamritparth
Sophia Diaz-Infante
@sophiaelisa

After spending just about all day trying to figure out the card counting challenge, I finally got it right! @mrburks Thank you again @moigithub for the help!
var count = 0;

function cc(card) {
// Only change code below this line
var answer = "";
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
answer = ++count;
break;

  case 10:
  case 'J':
  case 'Q':
  case 'K':
  case 'A':
answer = --count;
    break; 
  case 7: 
  case 8:
  case 9:
   answer = count; 


  }

if (answer >= 1 ) {
return count + " Bet";
}
else{

return count + " Hold"; 

}

// Only change code above this line
}

CamperBot
@camperbot
sophiaelisa sends brownie points to @mrburks and @moigithub :sparkles: :thumbsup: :sparkles:
:cookie: 210 | @mrburks |http://www.freecodecamp.com/mrburks
:warning: sophiaelisa already gave moigithub points
Dipesh Sukhani
@DKSukhani
@DKSukhani
Hello All, Need help. I used my FCC code onto a different website to test. However, it is not working.
I mean - the jquery section is not working
I also put the src <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js?ver=1.4.2'>
totes-ma-goats
@josephseverino

function updateRecords(id, prop, value) {

if (collection.id[prop].value !== "" && collection.id[prop] !== tracks){
collection.id[prop] = value;

}else if (collection.id[prop] === ""){
collection.id[prop] = value;
}
else if (collection.id[prop].value !== "" && collection.id[prop] == tracks) {
collection.id[prop].push(value);

}else if (collection.id[prop].value === ""){
delete collection.id[prop];
}

return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");

Can some explain why the above is returning "Cannot read property 'artist' of undefined?
Jason Keenan
@raavin
@DKSukhani do you need jquery ui??
Kevin Schwert
@kevinpschwert

On the Profile Lookup I am stuck on getting it to fully work. At one point I was able to get the first three of the solutions checked off and now I'm only able to get the last two. Here is my code:
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];

function lookUpProfile(firstName, prop){
// Only change code below this line
for (var i = 0; i < contacts.length; i++) {
if (contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop)) {
return contacts[i][prop];
} else if (contacts[i].firstName != firstName) {
return "No such contact";
} else {
return "No such property";
}

}
// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Sherlock", "number");

Diego Mayer
@Chrono79
@kevinpschwert you have to check all the contacts before you can say "No such contact"
also if you return in every branch, your loop will run only one time
Eric
@Code-Eric
function eliminate(x){


   return x !== "" && x !== false && x !== null && x !== undefined;

 }
  var result = arr.filter(eliminate);
  return result;
}
For some reason, this does not get rid of the null
Diego Mayer
@Chrono79
Asan Cody
@csordelet
I am working on a switch staement and have no idea what I am doing wrong. It's getting annoying now
Eric
@Code-Eric
whatttt but on FCC the output says null @Chrono79
bitgrower
@bitgrower
let's see the code @csordelet
Eric
@Code-Eric
I think I understand whats going on