Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Feb 01 00:26
    @bjorno43 banned @Ndoua
  • Jan 07 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:33
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • May 10 2019 09:13
    @bjorno43 banned @zhaokunhaoa
  • Apr 25 2019 17:12
    @mstellaluna banned @cmal
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:11
    thecodingaviator labeled #31179
  • Apr 01 2019 18:09
    thecodingaviator commented #31179
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:09
    thecodingaviator labeled #31182
  • Apr 01 2019 18:07
    thecodingaviator commented #31182
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator labeled #31190
  • Apr 01 2019 18:07
    thecodingaviator commented #31190
  • Apr 01 2019 18:05
    thecodingaviator commented #31157
  • Apr 01 2019 18:04

    thecodingaviator on master

    remove A (#31157) (compare)

  • Apr 01 2019 18:04
    thecodingaviator closed #31157
  • Apr 01 2019 18:04
    thecodingaviator closed #33788
  • Apr 01 2019 18:04
    thecodingaviator commented #33788
Moisés Man
@moigithub
@johnnyosullivan u not answering the question :)
:point_up: 27 de junio de 2017 20:13 1, 2 or 3
Johnny O'Sullivan
@johnnyosullivan
Am I not? Sorry. Let me revisit.
kumquatfelafel
@kumquatfelafel

@johnnyosullivan what value will destroyed have after run this code...

destroyed = 1;
destroyed = 2;
destroyed = 3;

^this bit. Will destroyed be 1?

pablovvb
@pablovvb
@moigithub @johnnyosullivan man, that's cleaner than mine :P I like it!! (and @johnnyosullivan , I'm exactly in the same place)
Johnny O'Sullivan
@johnnyosullivan
@kumquatfelafel @moigithub oh man, I'm having one of those moments...I don't understand the question.
georgebatton
@georgebatton
jnbjk
kumquatfelafel
@kumquatfelafel

@johnnyosullivan If one were to say

var destroyed = 1;
destroyed = 2;
destroyed = 3;
console.log(destroyed);

What would show up in console?

georgebatton
@georgebatton
Why can't I use for Stand in Line: arr.push(item);
var remove=arr.shift(item);
pablovvb
@pablovvb
@johnnyosullivan I think moi is into something with mine as well. I may be replacing once and again the value I want to get
Saif Ur Rahman
@saifsmailbox98
@georgebatton vvv return remove.
kumquatfelafel
@kumquatfelafel
@georgebatton ^^^ Shift doesn't require an argument.
georgebatton
@georgebatton
why does push require one but shift doesn't?
Saif Ur Rahman
@saifsmailbox98
@georgebatton push adds that to the array, shift is used to remove element.
kumquatfelafel
@kumquatfelafel
@georgebatton Shift just removes first element from array. Doesn't really care what we lowly humans and/or rodents have to say. :p
There's no need for any kind of special input in order to remove an element.
Johnny O'Sullivan
@johnnyosullivan
Wouldn't destroyed just be equal to the number you assign it in those cases?
Moisés Man
@moigithub
@johnnyosullivan code runs from top to bottom
@johnnyosullivan but it WONT have all 3 values
it can be 1 OR 2 OR 3... soo what value will be after the code is executed ?
Johnny O'Sullivan
@johnnyosullivan
3
?
Moisés Man
@moigithub
yep only last value prevails
kumquatfelafel
@kumquatfelafel
aye
Kent Saeteurn
@sansae

Hi all,
I am working on the "Arguments Optional" challenge. I have tested all 5 cases. The returned results are exactly what FreeCodeCamp wants, however, when click submit, only the top two cases are marked as correct. The last 3, which expects "undefined" to be returned, are marked incorrect. When testing for all 3 undefined cases in FCC's editor window, the returned result is "undefined" (It shows on the left hand column).

Does anyone know why FCC won't recognize the returned values of "undefined"?

kumquatfelafel
@kumquatfelafel

@sansae post code

(if you're doing something like return "undefined"; lose the "")

Johnny O'Sullivan
@johnnyosullivan
ok. so my problem is with the variable seek.
it's only taking the last item in the args array.
Kent Saeteurn
@sansae
@kumquatfelafel https://repl.it/JEqA/67
Moisés Man
@moigithub

@johnnyosullivan soo another concept
a loop repeat code

for (var x=1; x<= 3; x++){
    doSomething(x);
}

will do
doSomething(1)
doSomething(2)
doSomething(3)

kumquatfelafel
@kumquatfelafel
@sansae :point_up_2: see my reply. "undefined" != undefined.
"undefined" is a string that happens to be the word "undefined". undefined, on the other hand, is... well... undefined.
Johnny O'Sullivan
@johnnyosullivan
Thanks @moigithub and @kumquatfelafel . I have to retire for the evening, but you've set me straight.
CamperBot
@camperbot
johnnyosullivan sends brownie points to @moigithub and @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 378 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
:star2: 3440 | @moigithub |http://www.freecodecamp.com/moigithub
Johnny O'Sullivan
@johnnyosullivan
Or on the right path at least.
Kent Saeteurn
@sansae
@kumquatfelafel yikes. i just returned a string didn't I? lol Oops
@kumquatfelafel i fixed it
Moisés Man
@moigithub

@johnnyosullivan soo on ur code.. on each iteration u replacing destroyed values reassigning it
only last filter result prevail

var destroyed = [1, 2, 3, 1, 2, 3].filter() // when seek is 2
var destroyed = [1, 2, 3, 1, 2, 3].filter() // when seek is 3
last one return [1,2,1,2]

Kent Saeteurn
@sansae
@kumquatfelafel thank you!
CamperBot
@camperbot
sansae sends brownie points to @kumquatfelafel :sparkles: :thumbsup: :sparkles:
:cookie: 379 | @kumquatfelafel |http://www.freecodecamp.com/kumquatfelafel
kumquatfelafel
@kumquatfelafel
@sansae mayhaps. What it means though is that after quick alteration you've essentially passed the challenge :p
np
Maxwell Adams
@maxadams100

You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above, with no spaces between escape sequences or words.

Here is the text with the escape sequences written out.

FirstLinenewlinebackslashSecondLinebackslashcarriage-returnThirdLine
var myStr;"FirstLine\n\SecondLine\\rThirdLine"

Uhh that last line is what I tried. I have no clue what i'm doing help please.
Johnny O'Sullivan
@johnnyosullivan
Yeah that makes sense now @moigithub . I'll get it in the morning. Thanks again.
CamperBot
@camperbot
johnnyosullivan sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:warning: johnnyosullivan already gave moigithub points
kumquatfelafel
@kumquatfelafel

@maxadams100 if you wanted to assign 5 to a var, i, would you say
var i; 5?

(Your string itself is good.)

Saif Ur Rahman
@saifsmailbox98
:wave: :zzz:
kumquatfelafel
@kumquatfelafel
see ya