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
: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 (\"). ?
grandmasterundead
@grandmasterundead
yes but now i have to do that three lines into myVar
Joseph
@revisualize
jainishpanchal
@jainishpanchal
var myStr; // Change this line
I am a "double quoted" string inside "double quotes".
grandmasterundead
@grandmasterundead
the next one
var myStr = "FirstLine\nSecondLin\rThirdLine";
i've tried everything and i do not know how to do that
Ghulam Shabir
@ghulamshabir
@grandmasterundead need \\ before and after SecondLine
ml3ha
@ml3ha
Can someone help me understand how I can use a closure in my use case?
Joseph
@revisualize
@grandmasterundead SecondLin is not the same as SecondLine
jainishpanchal
@jainishpanchal
not yet
TracesOfNuts
@TracesOfNuts
@carpben ah i see where's the problem. hmm. Math.max uses numbers as arguments but you're using array instead
Ben Carp
@carpben
yes but the ... should spread the elements of the array.
Joseph
@revisualize
It does.
FCC gives you a warning.
It doesn't give you an ERROR
Just a warning.
grandmasterundead
@grandmasterundead
@revisualize aye, thanks, seems that i deleted a lot trying to make it work hehe :D @ghulamshabir it was confusing because I thought I had tot make them on three lines and in console it didn't show them on three lines.
CamperBot
@camperbot
grandmasterundead sends brownie points to @revisualize and @ghulamshabir :sparkles: :thumbsup: :sparkles:
:star2: 2845 | @revisualize |http://www.freecodecamp.com/revisualize
:star2: 1621 | @ghulamshabir |http://www.freecodecamp.com/ghulamshabir
Joseph
@revisualize
@carpben I used the spread operator when I solved that challenge the third time I did it.
Ghulam Shabir
@ghulamshabir
@grandmasterundead :smile:
grandmasterundead
@grandmasterundead
:D
Ben Carp
@carpben
@revisualize and am I using the operator correctly? Why doesn't it work?
Joseph
@revisualize
It does work.
Your other logic isn't correct.
mattcharlesh
@mattcharlesh
// Setup
var myPlants = [
  { 
    type: "flowers",
    list: [
      "rose",
      "tulip",
      "dandelion"
    ]
  },
  {
    type: "trees",
    list: [
      "fir",
      "pine",
      "birch"
    ]
  }  
];

// Only change code below this line

var secondTree = myPlants[1].list["1"]; // Change this line
Accessing Nested Arrays ...What did i miss?
Joseph
@revisualize
@mattcharlesh You're trying to access an array element with a string.
Quotes define strings.
TracesOfNuts
@TracesOfNuts
@carpben ah. I'm not familiar with the ... syntax. this is what I did instead.
function largestOfFour(arr) {
  var i,j,newArr=[];
  newArr.length = arr.length;
  for (i = 0; i<arr.length; i++) {
    newArr[i] = 0;
    for (j = 0; j<arr[i].length; j++) {
      if (arr[i][j]>newArr[i]) {
        newArr[i]=arr[i][j];
      }
    }
  }
  return newArr;
}
mattcharlesh
@mattcharlesh
@revisualize Thanks Joseph
CamperBot
@camperbot
mattcharlesh sends brownie points to @revisualize :sparkles: :thumbsup: :sparkles:
:star2: 2846 | @revisualize |http://www.freecodecamp.com/revisualize
Joseph
@revisualize
@carpben Based on this code here: :point_up: January 4, 2017 10:12 PM Your issue is..
return statements cause functions to halt and return. If you're trying to do a return inside of a loop it will cause the function to halt and return the information that you specify.
TracesOfNuts
@TracesOfNuts
@carpben share me your code if you managed to use the Math.max for that problem
Joseph
@revisualize
So, if your loop has a return statement inside of it.. It doesn't really loop.
Unless of course that return is inside of another conditional block.
@TracesOfNuts I have 3