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
khaduch @khaduch - now I'm leaving again for the night... happy coding everyone!
ml3ha
@ml3ha

function titleCase(str) {
var word = str.split(" ");
for (var i = 0; i < word.length; i++) {
word[i].substring(0,1).toUpperCase();
}

}

Nathan Parsons
@10milliondollarwebpage
your code did not work
ml3ha
@ml3ha
You need to return the string
do a .join() on word.
Ogundele Olumide
@Lumexralph
@unlawfulspoonisback @ml3ha is on the way with you, this is how you'll continue.....word is an array, right?
超峰
@fenghuilu

function lookUp(firstName, prop){
// Only change code below this line
for(var i=0;i<contacts.length;i++){

if(contacts[i][firstName] === firstName){
if(contacts[i].hasOwnProperty(prop)){
return contacts[i][prop];
}else{
return "No such property";
}
}

if(i == contacts.length-1){
return "No such contact";
}

}

it does not work too
ml3ha
@ml3ha
Oh ok im on the page, looks like theres some edge cases @unlawfulspoonisback
Ogundele Olumide
@Lumexralph
@unlawfulspoonisback you'll use for loop like you did
@fenghuilu if(contacts[i][firstName] === firstName){ should be if(contacts[i]["firstName"] === firstName){
ml3ha
@ml3ha
Here, i just did the challenge:

function titleCase(str) {
var splitted = str.split(" ");
for (var i = 0; i < splitted.length; i++) {
splitted[i] = splitted[i].substring(0,1).toUpperCase() + splitted[i].substring(1).toLowerCase();
}
return splitted.join(" ");
}

titleCase("I'm a little tea pot");

passed the test cases
try to understand what im doing there though
Coy Sanders
@coymeetsworld
@ml3ha try not to give out the answer when helping please
ml3ha
@ml3ha
ok
HeebieGeeBee
@HeebieGeeBee
@Lumexralph you sure about that?
grantknaver
@grantknaver
how to use func... arr.func doesn't work
ml3ha
@ml3ha
my bad
Coy Sanders
@coymeetsworld
its ok no worries, people won't learn if you just give answers out
then they move on without understanding things they need to know to complete other challenges
grantknaver
@grantknaver
Ive been trying if (arr.func ){
here is the challenge
Ogundele Olumide
@Lumexralph
@HeebieGeeBee about what?
HeebieGeeBee
@HeebieGeeBee
['firstName']?
if(i == contacts.length-1){
return "No such contact"; @fenghuilu this is a problem
Ogundele Olumide
@Lumexralph
@HeebieGeeBee either Object.firstName or Object["firstName"] they are both properties in object
HeebieGeeBee
@HeebieGeeBee
i think its [firstName]
超峰
@fenghuilu
if(contacts[i][firstName] === firstName){ should be if(contacts[i]["firstName"] === firstName){ this works,but i do not understand...
HeebieGeeBee
@HeebieGeeBee
['firstName'] would imply its a string 'firstName' wouldnt it?
超峰
@fenghuilu
firstName already has ""
Ogundele Olumide
@Lumexralph
@HeebieGeeBee he's accessing the firstName property in contacts to check against firstName parameter
Aman
@amansat
Stuck here. Don't know what to do. Please help.
HeebieGeeBee
@HeebieGeeBee
yeah and firstName is a parameter not a string
isnt it?
超峰
@fenghuilu
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"]
}
];
lookUp("Akira", "likes");
HeebieGeeBee
@HeebieGeeBee
oh ok sorry
its a string
grantknaver
@grantknaver
any idea guys
HeebieGeeBee
@HeebieGeeBee
think im getting mixed up with the record one
jakobmara
@jakobmara
can someone help me with the "Title Case Sentence"?
HeebieGeeBee
@HeebieGeeBee
@Lumexralph sorry
Ogundele Olumide
@Lumexralph
@fenghuilu when you're done looking through the contacts i.e when the loop is done...just return no such contacts outside the loop.....
超峰
@fenghuilu
firstName already has "" ,why i have to add another "" when iuse it?
Ogundele Olumide
@Lumexralph
@fenghuilu :point_up: :point_up: January 7, 2017 6:57 AM look at what @HeebieGeeBee said here too
@HeebieGeeBee keine Probleme :smile:
Nathan Parsons
@10milliondollarwebpage
can someone help I still dont know what to do on Title Case a Sentence