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
CamperBot
@camperbot
sainiabhi sends brownie points to @adityavisen :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @adityavisen |http://www.freecodecamp.com/adityavisen
Ben Carp
@carpben
I'm using the code: manNum = Math.max(...arr[i]);
Aditya Singh
@adityavisen
@sainiabhi let me check
Ben Carp
@carpben
geting a message spread/rest oerator only available in Es6
Abhishek Saini
@sainiabhi
@TracesOfNuts cool it worked thanks
CamperBot
@camperbot
sainiabhi sends brownie points to @tracesofnuts :sparkles: :thumbsup: :sparkles:
:cookie: 256 | @tracesofnuts |http://www.freecodecamp.com/tracesofnuts
Aditya Singh
@adityavisen
Cff.PNG
@carpben
Joseph
@revisualize
@johnnunns Still stuck?
TracesOfNuts
@TracesOfNuts
@sainiabhi glad to help! technically what you're doing is also correct. it's just that FCC checks everything in the function
Abhishek Saini
@sainiabhi
@TracesOfNuts

function sumAll(arr) {
  var numInRange = 0;
  var maxNum = Math.max.apply(null, arr), minNum = Math.min.apply(null, arr);
  for(var i = minNum; i <= maxNum; i++){
    numInRange += i; 
  }
  return numInRange;
}

sumAll([5, 9]);
John Nunns
@johnnunns
had to do some looking at the record collection I did a while back. Now I'm just figuring out breaking the other statements away from the for loop
@revisualize
Joseph
@revisualize
@johnnunns NO!
Ben Carp
@carpben
Hi everyone,
In this exercise
https://www.freecodecamp.com/challenges/return-largest-numbers-in-arrays
I tried using the spread method
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max
I'm using the code: manNum = Math.max(...arr[i]);
geting a message spread/rest oerator only available in Es6
Is my syntax correct? (...arr[i]) ?
Why doesn't it work?
Joseph
@revisualize
@johnnunns Look the code that I just saw was almost correct.
Abhishek Saini
@sainiabhi
reduced the code too @TracesOfNuts
Joseph
@revisualize
@johnnunns Can you answer some more questions with me?
TracesOfNuts
@TracesOfNuts
@sainiabhi looks good!
John Nunns
@johnnunns
@revisualize haha let me show you where I'm at now because I have 4 of 5 reading right

//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
for(i=0;i<contacts.length;i++){
  if(contacts[i].firstName === firstName && contacts[i].hasOwnProperty(prop) ){
  return contacts[i][prop];
}
}
  if( contacts.firstName!== firstName){
  return "No such contact";
} else (contacts.prop!==prop){
  return "No such property";

// Only change code above this line
}
}
// Change these values to test your function
lookUpProfile("Harry", "likes");
TracesOfNuts
@TracesOfNuts
@carpben hi can you share your code?
Ben Carp
@carpben
Here it is:

function largestOfFour(arr) {
// You can do this!
var maxNum;
for(i=0; i<i.length(); i++)
manNum = Math.max(...arr[i]);
return maxNum;
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Joseph
@revisualize
@johnnunns Umm.. Put your No such property back inside of your for loop.
John Nunns
@johnnunns
with akira likes
when it's inside the for loop it only tests right on the first contact
Ghulam Shabir
@ghulamshabir
@johnnunns else does not take a condition remove the condtion and move that else part inside loop to connect it with first if
Joseph
@revisualize
@johnnunns show me your code. (JUST THE FUNCTION!)
@johnnunns You do NOT need to continue pasting the contacts array. We don't want to see it.
*yawn*
TracesOfNuts
@TracesOfNuts

@carpben hmm maybe its the

...

how bout trying

manNum = Math.max(arr[i]);
John Nunns
@johnnunns
@revisualize sorry for spamming with contacts. But you can read my code inside where it guides you to write the code
grandmasterundead
@grandmasterundead
hello, i don't understand an exercise and i have no idea how to solve it
it's this one : var myStr = "FirstLine\n\SecondLine\r\Third Line";
John Nunns
@johnnunns
@revisualize I'm actually not enjoying your help anymore, thanks anyways bud. I'll figure it out myself
CamperBot
@camperbot
johnnunns sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2844 | @revisualize |http://www.freecodecamp.com/revisualize
Ghulam Shabir
@ghulamshabir
@grandmasterundead which one ?
Joseph
@revisualize
@grandmasterundead Third Line is not the same as ThirdLine
grandmasterundead
@grandmasterundead
escape sequences
Assign the following three lines of text into the single variable myStr using escape sequences.
FirstLine
\SecondLine\
ThirdLine
but i do not know how to do that
everything i;ve tried, in vain
Joseph
@revisualize
@grandmasterundead Third Line is not the same as ThirdLine
Ben Carp
@carpben
@TracesOfNuts This won't work as the max function needs to receive number parameters and not an array. I thought the ... somehow breaks it into the elements. That's what it should, but I might misunderstood the syntax.
Ghulam Shabir
@ghulamshabir
@grandmasterundead backslash should be before \r not after to it
jainishpanchal
@jainishpanchal
How to use escaped double quotes (\"). ?