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
CP
@lubere0102
very good
Michael
@michaelpautov

hello
var myVar = 87;

// Only change code below this line
myVar = myVar;
myVar = myVar;
myVar = ++myVar;

dont' working ex myVar = myVar should be changed
Keone Martin
@Athaman
myVar = myVar; won't do anything, all it does is tell myVar to be itself
like 5 = 5;
the increment by one shorthand needs to be on the end of the variable like myVar++;
but it doesn't need to be reassigned because that's part of the short hand
so myVar = myVar++; is the same as myVar = myVar = MyVar + 1;
Blauelf
@Blauelf
++myVar first increments myVar, then evaluates to the incremented value (in contrast to myVar++, which also increments myVar, but evaluates to the old value), so myVar = ++myVar; should be same as ++myVar;
Keone Martin
@Athaman
oh right, i didn't think JS had increment first in it sorry...
Michael
@michaelpautov
thank
Keone Martin
@Athaman
you're welcome
Myuuks
@Myuuks
@Athaman i dont understand what's asked for the exercice called "Woord Blanks"
-o
Blauelf
@Blauelf
You are meant to return a sentence containing all those words passed to your function.
Keone Martin
@Athaman
similar to before when you used your name + another string
Blauelf
@Blauelf
@Myuuks So for "big","dog","ran","quickly" it might return something like "When I saw a big dog, I ran quickly."
Ajith
@ajithvallabai
diff btwn two arrays .there is a mistake in if loop but i dnt know to recify it

function diffArray(arr1, arr2) {
  var newArr = [];
  var oldArr=[];
  // Same, same; but different.
  for(var i=0;i<arr1.length;i++)
    {
      for(var j=0;j<arr2.length;j++)
      {  
      if(arr1[i]==arr2[j])

      newArr.push(arr2[j]);
        else
          oldArr.push(arr2[j]);

      }

    }

  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Keone Martin
@Athaman
you just need to do it for the variables passed into the function, called myNoun, myVerb, and the other 2
Myuuks
@Myuuks
i just need to do like : myNoun + myAdjective + myVerb etc.. ?
Keone Martin
@Athaman
but remember spaces
so myNoun + " " + myAdjective
and you can put in your own words too like @Blauelf said if you want to be creative
Blauelf
@Blauelf
@Myuuks That would lead to "dogbigranquickly", the words have to remain separate.
Myuuks
@Myuuks
yeah yeah i see
alright thanks
Keone Martin
@Athaman
np
Markus Kiili
@Masd925
@ajithvallabai You are pushing if there is an element on the other array that differs from it. You should push if the element differs from all the elements on the other array?
Blauelf
@Blauelf
@ajithvallabai You cannot decide whether to include something based on a single match, you would have to make sure the element is not anywhere in the whole other array before you push it to the result array.
Saurabh Parihar
@parihars
How to solve Profile Lookup Problem

//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
if(contacts.hasOwnProperty(firstName) && contacts.hasOwnProperty(prop))
return contacts[prop];
else if(contacts.hasOwnProperty(firstName))
return "No such contact";

// Only change code above this line
}

// Change these values to test your function
lookUpProfile("Akira", "likes");

Myuuks
@Myuuks
what i dont understand is why we dont put our text into : var result
Markus Kiili
@Masd925
@parihars First you need to loop or iterate through the contacts array.
@parihars Then figure out how to access one contact.
Ajith
@ajithvallabai
thanks @Masd925 @Blauelf
CamperBot
@camperbot
ajithvallabai sends brownie points to @masd925 and @blauelf :sparkles: :thumbsup: :sparkles:
:star2: 1528 | @masd925 |http://www.freecodecamp.com/masd925
:star2: 1825 | @blauelf |http://www.freecodecamp.com/blauelf
Saurabh Parihar
@parihars
@Masd925 I have to make a loop inside function
Markus Kiili
@Masd925
@parihars Yes.
Ajith
@ajithvallabai
@Blauelf @Masd925 which loop is better to use
Markus Kiili
@Masd925
@parihars For loop is fine.
Myuuks
@Myuuks
@Blauelf @Athaman can you check my text ^^
pls :)
Darth Skywalker
@adityaparab

@ajithvallabai :smile:

For loop in case of small number of iterations. Like in multiples of 1000s
While loop (iterating backwards) in case of millions of records. ;)

Blauelf
@Blauelf
@ajithvallabai I think I used implicit loops, filter for cleaning from duplicates, and indexOf for finding out whether an element is in the other array.
Saurabh Parihar
@parihars
@Masd925 I am not getting can you please explain me
Blauelf
@Blauelf
@Myuuks Can you post your code?