Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 20:09
    @krisb1220 banned @Gastony
  • May 14 22:38
    @bjorno43 banned @minitechtips_twitter
  • May 14 22:37
    @bjorno43 banned @real-action
  • Feb 01 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

Keone Martin
@Athaman
yeah, having not fixed data types is a brave new world for me too @Myuuks
@cnj1987 ok so the challenge is pointing out how returns work. when you call a function it will send back a piece of information in the return statement. but if you don't do anything to capture that information it just gets lost. so here they want you to declare a variable next to the processArg(7) line like var processed = processArg(7);
cnj1987
@cnj1987
AH!
Divyam Bhagchandani
@divyambhagchandani

guys ! help me with counting cards problem !

var count = 0;

function cc(card) {
// Only change code below this line

if(card==2,3,4,5,6){
count++;
}
if(card==10,'J','Q','K','A'){
count--;

}
if(count>0){
return count "Bet" ;

}
if(count<0){

return count "Hold";

}

return "Change Me";
// Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');

Keone Martin
@Athaman
so that when processArg(num) is run it sends back (num + 3) /5 which gets stored in the new variable... so in this case it will send back 2 and processed will be set to 2
Markus Kiili
@Masd925
@divyambhag return count+" Bet"; etc
cnj1987
@cnj1987
That makes so much more sense. Thanks @Athaman, I passed it now. :D
CamperBot
@camperbot
cnj1987 sends brownie points to @athaman :sparkles: :thumbsup: :sparkles:
:warning: cnj1987 already gave athaman points
Keone Martin
@Athaman
glad to help :)
cnj1987
@cnj1987
I really struggle with functions, still. It seems like pretty much every time I see one, I'm lost
Divyam Bhagchandani
@divyambhagchandani
oh thanks @Masd925
CamperBot
@camperbot
divyambhag sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 1529 | @masd925 |http://www.freecodecamp.com/masd925
CodeNeophyte
@CodeNeophyte
hello all. I'm having some trouble with my twitch zipline. I'm not sure why from the two channels that are supposed to give me an error only one is coming through. Any help would be greatly appreciated. http://codepen.io/TheCodeNeophyte/pen/yOWQzV?editors=0010
Saurabh Parihar
@parihars
@adityaparab are you here
Darth Skywalker
@adityaparab
@parihars : Whats up?
Saurabh Parihar
@parihars
come to codepad

//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"]
}
];

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

// Change these values to test your function

(lookUpProfile("Akira", "address"));

how to return No such property
Help me
CamperBot
@camperbot

:point_right: adding snippets to sublime text [wiki]

Adding Snippets To Your Sublime Text Installation

If you are a user of sublime text (I hope you are, it kicks ass. You can get it here), then you may have already noticed some of the tab completion capabilities. For example, when you are opening an html tag such as <p>, it automatically closes the tag as soon as you type /. You can get similar functionality for pieces of code you end up re-writing over and over, and it's surprisingly easy!

Here's an example, which activates after typing div and then tab:

alt text

:pencil: read more about adding snippets to sublime text on the FCC Wiki

Saurabh Parihar
@parihars
Blauelf
@Blauelf
@parihars You return the property without checking it is there. Instead, you could simply nest some additional if with if(contacts[i].hasOwnProperty(prop)), also, I do not see any use of j and k.
Susheel Palakurthi
@ush19

So I'm having a bit of trouble with my program

Why does it work with the id being in [] brackets instead of .. dot notation? Doesn't [] bracket notation use zero indexed? So if it's [123] it'd be accessing thr 124th element?


// 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 is non blank and prop is not tracks, then update or set the value for the prop
 *  if prop is tracks and value is non blank, push value onto end of tracks array
 *  if value is blank, delete that prop
 */

  if ((value !== "") && (prop !== "tracks"))
    {
      //update or set the value for the prop
      collection[id][prop] = value;
    }

  if ((prop === "tracks") && (value !== ""))
    {
      //push value onto end of tracks array
      collection[id].tracks.push(value);
    }

  if (value == "")
    {
      //delete prop

    }


  return collection;
}

// Alter values below to test your code
updateRecords(5439, "artist", "ABBA");
Blauelf
@Blauelf
@ush19 [] notation is also used for accessing properties. You can use dot notation only if the property name is a valid identifier name and it is static, as collection.id would equal collection["id"], which has nothing to do with variable id.
Saurabh Parihar
@parihars
@Blauelf How do i check if prop exists in contact list or not
Blauelf
@Blauelf
And passing non-strings for property name will implicitly convert them to string, so 5439 is treated like "5439".
Saurabh Parihar
@parihars
@Blauelf https://coderpad.io/R3ERDJ79 join here to help me
Blauelf
@Blauelf
@parihars You have your check. Just put that in the place where you return the property and return the property or "No such property" depending on the outcome.
@parihars Stop spamming that link.
cnj1987
@cnj1987
Okay, I don't even have a clue what I'm doing with this next one. :/
Saurabh Parihar
@parihars
thats not spam
here you just edit my code
Keone Martin
@Athaman
i haven't even been in this room but if @Blauelf says it's spam it's spam, he's telling you not to repeat it
Saurabh Parihar
@parihars
wtf
Keone Martin
@Athaman
if you ask for help we'll help, but there's no point in repeating a request, if we ignore it it's because it's not something we want to do at the moment for whatever reason
Susheel Palakurthi
@ush19
@parihars chill, keep it friendly
Saurabh Parihar
@parihars
@Athaman go in freecode camp chat
this is chat room for help
@ush19 yeah bro
Blauelf
@Blauelf
I want to help here, not on external website.
Susheel Palakurthi
@ush19
@Blauelf alrightty, i think i get it, thanks!
CamperBot
@camperbot
ush19 sends brownie points to @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 1827 | @blauelf |http://www.freecodecamp.com/blauelf
Saurabh Parihar
@parihars
@Blauelf so just said this i will not ask you again
Keone Martin
@Athaman
... i chill in this room because i regularly help people with inquiries
Saurabh Parihar
@parihars
Do anybody wants to help me
Blauelf
@Blauelf
Sure, but only here on chat, not on external website.
Saurabh Parihar
@parihars
ok