Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Christopher
@subtlefluids01
hi guys can someone check what's wrong with my code on falsy bouner challenge
Norvin Burrus
@ndburrus
@sanj1591
ok, we need to take the given string, here:
"FirstLine newline backslash SecondLine backslash carriage-return ThirdLine" (ignore the spacing) and replace the appropriate text (bold words) with the escape coding (use the Code/Output chart)...
@subtlefluids01 code?
Christopher
@subtlefluids01

function isFalsy(n){
return n !== null && n !== undefined && n !== false && n !== 0 && n !== "" && n!== isNaN(true);

}
function bouncer(arr) {
// Don't show a false ID to this bouncer.

return arr.filter(isFalsy);
}

bouncer([7, "ate", "",false, null, 9, null, undefined, NaN]);

it didnt work out for isNaN(true), i tried changing the value for isNaN() parameter but never worked out well
Norvin Burrus
@ndburrus
@subtlefluids01 did you consider using the boolean object?
Andrew Perrin
@Pezz18
@JonSnow08 hey, how are you getting on!? hope my code isnt too confusing!
Christopher
@subtlefluids01
@ndburrus I googled about it, but i thought arr.filter is easier ?
Xavier Velez
@JonSnow08
@Pezz18 no not at all just reading through right now
stonefmagiecurata
@stonefmagiecurata
@subtlefluids01 'n!== isNaN(true)' is bad
@subtlefluids01 !isNaN(n)
Christopher
@subtlefluids01
@stonefmagiecurata what's the correct way ? tell me bro
ah okay
stonefmagiecurata
@stonefmagiecurata
@subtlefluids01 you have to pass the param to isNaN
@subtlefluids01 and that will return true or false
Christopher
@subtlefluids01
@stonefmagiecurata oh thanks dude!
CamperBot
@camperbot
subtlefluids01 sends brownie points to @stonefmagiecurata :sparkles: :thumbsup: :sparkles:
:cookie: 273 | @stonefmagiecurata |http://www.freecodecamp.com/stonefmagiecurata
Norvin Burrus
@ndburrus

@subtlefluids01

The Boolean object represents two values, either "true" or "false". If value parameter is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (""), the object has an initial value of false.

Christopher
@subtlefluids01
@ndburrus got it solved, thanks mate!
CamperBot
@camperbot
subtlefluids01 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:star2: 1228 | @ndburrus |http://www.freecodecamp.com/ndburrus
Norvin Burrus
@ndburrus
@subtlefluids01 way to go! :+1:
Christopher
@subtlefluids01
the idea behind using boolean, because all falsy will return false immediately ? @ndburrus
Xavier Velez
@JonSnow08
@Pezz18 move the var lat; var lon; declarations inside the document ready function
@Pezz18 should fix your issue
$(document).ready(function(){
  var long;
var lat;
  $.getJSON("http://ip-api.com/json/", function(data) {
   lat = data.lat;
    long = data.lon;
    console.log(lat);
   });

  getWeather(metric[0], metric[1], metric[2], sun);
@ndburrus hey buddy how are you?
Norvin Burrus
@ndburrus
@subtlefluids01 well, it takes care of all the falsy values....
@JonSnow08 im good! how are you? nice to see you!
Andrew Perrin
@Pezz18
@JonSnow08 ahhh, thanks alot :) seems so simple! got there in the end! cheers
CamperBot
@camperbot
pezz18 sends brownie points to @jonsnow08 :sparkles: :thumbsup: :sparkles:
:warning: pezz18 already gave jonsnow08 points
Xavier Velez
@JonSnow08
@Pezz18 its always the simplest things, I spent hours trying to find mistakes in my code last night only to find out my .css calls weren't closed properly. every single one, I messed up when I used a replace function sublime text has
@ndburrus not much man, almost done with my front end. once I finish the Simon game I'm all done
Andrew Perrin
@Pezz18
ah yeah, thats my next task now,, converting my codepen into a html, css and js script files to load from my desktop
Norvin Burrus
@ndburrus
@JonSnow08 nice work! :sparkles:
Xavier Velez
@JonSnow08
@Pezz18 you can export it to github and then you just have to put the css and js links in there
@Pezz18 if you need help, let me know
@ndburrus thank you, how are you?
CamperBot
@camperbot
jonsnow08 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:star2: 1229 | @ndburrus |http://www.freecodecamp.com/ndburrus
Andrew Perrin
@Pezz18
@JonSnow08 well, i have copied and pasted the html, css and js into their own files, the html and css appear to be linked, but the js isnt running, ive added a script tag in my head - and think i have linked jquery correctly too?
Xavier Velez
@JonSnow08
I'm having a bit of trouble with my simon game if anybody has a second
@Pezz18 do you have them in the same folder?
Andrew Perrin
@Pezz18
yeah. have a main folder, then an assets folder with stylesheets, js etc,,
Xavier Velez
@JonSnow08
whats your script link look like
Andrew Perrin
@Pezz18
@JonSnow08 <script type="text/javascript" src="assets/javascript/script.js"></script>
i converted over the random quote generator challenge ok though!
Norvin Burrus
@ndburrus
@JonSnow08 :point_up: July 31, 2016 11:28 AM