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
schizo99
@shashank1999coder
no The second elements in each of your sub-arrays must all be numbers
aichellie
@aichellie
okay. I know my code is messy :(
Greg Duncan
@GregatGit
@aichellie first should be var firstLetter
techiespace
@techiespace

// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};

function checkObj(checkProp) {
// Your Code Here
if(myObj.hasOwnProperty(checkProp))
return myObj.checkProp;
return "Not Found";
}

// Test your code by modifying these values
checkObj("gift");

what is wrong with this code?
I'm trying to access properties with . instead of []
mosessaleh
@mosessaleh
wordBlanks("dog", "big", "ran", "quickly") should contain all of the passed in words separated by non-word characters (and any additional words in your madlib)
techiespace
@techiespace
[checkProp] instead of .checkProp works fine! Why?
schizo99
@shashank1999coder
abraham anak agung
@padunk
you object don't have checkprop key, checkprop is a parameter. @techiespace
techiespace
@techiespace
isn't it a variable with the value gift, pet, etc?
abraham anak agung
@padunk
@techiespace no, if u write myObj.checkProp it will look for checkProp key
techiespace
@techiespace
okay thanks @padunk
CamperBot
@camperbot
:cookie: 339 | @padunk |http://www.freecodecamp.com/padunk
techiespace sends brownie points to @padunk :sparkles: :thumbsup: :sparkles:
abraham anak agung
@padunk
@shashank1999coder u just write it [["beer", 2]]
@mosessaleh shw ur code
MrityunjaiMishra
@MrityunjaiMishra
i cant use praseInt in freecode camps editor
abraham anak agung
@padunk
it is parseInt not prase
mosessaleh
@mosessaleh

function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
var result = "";
// Your code below this line

// Your code above this line
return result;
}

// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");

abraham anak agung
@padunk
@mosessaleh your result must return a sentence that contains all those words
example result = text + myNoun + text + myVerb + .....etc
Kamal
@kpbro
Caesars Cipher:
i have created the code which is working perfectly but using a very bad logic and code is long. What can be easier method and simpler of doing this?
function rot13(str) { // LBH QVQ VG!
/*Here what I have done is 

1st: make array of utf-16 codes of all characters of given string using for loop and str.charCodeAt()
2nd: iterate through this array and make newArray using str1.map and if-else if. This returns new array which has decoded value of each alphabets(utf code) and returns the same value for non-alphabets
3rd: again iterate through this newArray and change utf codes to corresponding character using String.fromCharCode()
4th: join this array using newArray.join('')*/
  var str1 =[];
for(var i=0;i<str.length;i++){
 str1.push(str.charCodeAt(i));
}

  var newArray = str1.map(function(x){
   if(x >=65 && x<=77){return x+13;} 
    else if(x>77 && x<=90){return x-13;}
    else{return x;}
  });

  newArray = newArray.map(function(y){
    return String.fromCharCode(y);
  });


 return newArray.join('');
}

// Change the inputs below to test
rot13("LBH QVQ VG");
abraham anak agung
@padunk
@kpbro ur code is better than me :smile:
Kamal
@kpbro
@padunk hahaha thanks
CamperBot
@camperbot
kpbro sends brownie points to @padunk :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @padunk |http://www.freecodecamp.com/padunk
abraham anak agung
@padunk
if u want to know more :caesars cipher
rugano
@rugano
Hello campers,
mosessaleh
@mosessaleh

var result = "Cat" + myNoun + "Little" + myAdjective + "Hit" + myVerb + "slowly" + myAdverb;

It didn't work

Kamal
@kpbro
@padunk logic is same.. just codes are little different
rugano
@rugano
Can someone help me identify the unexpected token , at the Javascript code since i have tried to delete some commas without success.here: https://codepen.io/Njue/pen/NgbxBa
abraham anak agung
@padunk
@mosessaleh you need space between word.
rugano
@rugano
@Chrono79 hi,
abraham anak agung
@padunk
@rugano line 45 ;?
Manthan Gandhi
@manthangandhi
stuck at Make Object Properties Private can anyone help?
Dima Doulov
@dimadoulov

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

What am i doin wrong here?

Oh boy how do i send code so i doesnt look like that
Kamal
@kpbro
@dimadoulov please use proper format to show your code here
Dima Doulov
@dimadoulov
How?
Kamal
@kpbro
:point_up: June 18, 2017 12:45 PM like I did this
Dima Doulov
@dimadoulov
How to make it so it sends like that
Kamal
@kpbro
``` then shift+enter then paste your code and send
mosessaleh
@mosessaleh
@padunk Done thnx
CamperBot
@camperbot
mosessaleh sends brownie points to @padunk :sparkles: :thumbsup: :sparkles:
:cookie: 341 | @padunk |http://www.freecodecamp.com/padunk
Dima Doulov
@dimadoulov
```
function lookUpProfile(firstName, prop){
// Only change code below this line
for (i = 0; i < contacts.length; i++){
if (contacts[i].firstName == firstName){
if(contacts[i].hasOwnProperty(prop)){
return contacts[i][prop];
} else if (!contacts[i].hasOwnProperty(prop)) {
return "No such property";
}
else {
return "No such contact";
}
}
}
// Only change code above this line
}
Didnt work