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
a27-suryansh
@a27-suryansh
Got it Thanks @forwebtech
Aizaz Shahid
@aizazshahid
@rugano it only check one time but you have more than one profiles !
rugano
@rugano
@forwebtech ok,so how should i correct that?
Aizaz Shahid
@aizazshahid
@rugano also your conditional statement is wrong because you are required to check into object, for that we do that,

if ( first name argument  equal to  the first name in your contacts  
 &&
prop argument equal to the property in your contacts )
```
Mostafa Hesham
@mhesham32
please help me understanding indexOf()
Aizaz Shahid
@aizazshahid
@rugano try to use loop
@mhesham32 Index Of
Ramesh Mahajan Remi
@remimahajan
Please help me with this
Aizaz Shahid
@aizazshahid
@rugano try to make that :smile:
function lookUpProfile(firstName, prop){

    for ( i = 0 ;i < contacts.length; i++ ) {
        // checking firstName from our data
        if (firstName == firstName in your contacts object) {

            // checking whther our profiles have that property or not
            if( prop is equal to the property in your contacts object ) {
                return that property from your object;
            } else {
                return 'No such property';
            }
        }       
    }
    return 'No such contact';
}
Ramesh Mahajan Remi
@remimahajan
why?
My code is wrong?
anyone please help me
Khoa Le
@Zacele
hey guys
Aizaz Shahid
@aizazshahid
@remimahajan your code is almost fine ! but you have to put return 'no such contact' out of the loop !
Khoa Le
@Zacele
what is the difference between 2 of these versions of the code

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
    var newArr= arr.push(num);
  return newArr;
}
and this
Pieter Stokkink
@forkerino
hello
Khoa Le
@Zacele

function getIndexToIns(arr, num) {
  // Find my place in this sorted array.
   arr.push(num);
  var newArr =arr ;
  return newArr;
}

getIndexToIns([10, 20, 30, 40, 50], 30);
why the first one return newArr as like arr.push(num).length();
and the second one return a new Arr with the new item
Pieter Stokkink
@forkerino
@Zacele the first one puts a number in newArr (.push returns a number), the second puts a reference to the array in newArr
Aizaz Shahid
@aizazshahid
@Zacele first one is fine, but in second one you are not getting new array, because array.push(num) returns the new array, don't change the existing once !
Ramesh Mahajan Remi
@remimahajan
ah ok got it thanks @forwebtech
CamperBot
@camperbot
remimahajan sends brownie points to @forwebtech :sparkles: :thumbsup: :sparkles:
:cookie: 312 | @forwebtech |http://www.freecodecamp.com/forwebtech
Aizaz Shahid
@aizazshahid
@forkerino i told something wrong please correct me ??
Khoa Le
@Zacele
but why in the 2nd one
Aizaz Shahid
@aizazshahid
Khoa Le
@Zacele
return newArr give a whole new Array with the item pushed into it
Jefferson
@jeffersonnnn
Hi guys, i m stuck at the Nesting For Loops challenge, can i get help, please?


function multiplyAll(arr) {
  var product = 1;
  // Only change code below this line
  for (var i = 0; i < arr.length; i++) {
    for (var j = 0; i < arr[i].length; i++)
      return (arr[i][j] *= product);
  }
  // Only change code above this line
}

// Modify values below to test your code
multiplyAll([[1,2],[3,4],[5,6,7]]);
Pieter Stokkink
@forkerino
This message was deleted
Mostafa Hesham
@mhesham32
it keeps saying arr.toLowerCase(); is not a function WHY?

function mutation(arr) {
  arr=arr.toLowerCase();
  var first=arr[0];
  var second=arr[1];
  var index=first.indexOf(first,second);
  if(index===second.length){
    arr=true;
  }else{
    arr=false;
  }


  return arr;
}

mutation(["hello", "hey"]);
CodeGeek3
@codeGeek3
I am back
Khoa Le
@Zacele
toLowerCase() only affect on string
Pieter Stokkink
@forkerino
@forwebtech .push returns a number (the new length). so if you assign to a variable, that will be a number. It changes the array in place. So if you assign the array to something, it will contain a reference to the same array
CodeGeek3
@codeGeek3
heyllo
Khoa Le
@Zacele
@mhesham32 you cannot apply the method toLowerCase() to an Array
CodeGeek3
@codeGeek3
I am back
what do you wnat to do
?
@mhesham32 your loop stop at the first iteration, because of the return statement
Hamza OUALI
@mhypi
blob
hello guys, i have some truble with the Escape Sequences in Strings on JavaScript session someone can help me with this ?
Khoa Le
@Zacele
@mhypi \n\ is enough
Pieter Stokkink
@forkerino
@mhypi SecondLine capital S
amit kumar soni
@4mit
can anyone explain me please how you get LCM(1,5) =60 in question Smallest Common Multiple
Mostafa Hesham
@mhesham32
@Zacele thaks but can you help me understand indexof