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
Tom
@moT01
then - get the search term
then create the url
then make the call
you could probly combine the 2 middle steps
Ismail Hozain
@ismailhozain
i am getting the error that the search part of my link is not set
Tom
@moT01
cause you didn't follow my directions
Ismail Hozain
@ismailhozain
?
oh
Tom
@moT01
the way you have it - the url gets set when the document loads , and the #input is empty
you need to set it after the button click
Ismail Hozain
@ismailhozain
ok
not working
Tom
@moT01
dont forget to put () at the end of val
.val();
Ismail Hozain
@ismailhozain
it worked
or at least in my console it did
ok i got it working fully
thanks guys
Ismail Hozain
@ismailhozain
but how would i address the individual elements
Tom
@moT01
what do you mean, the data you get back?
Ismail Hozain
@ismailhozain
nvm
never mind
Pagnito
@Pagnito
anyone use materialize css alot?
iso
@iso1048
Is anyone available to help with the 'everything be true' challenge? I can pass all tests except the one below - it should return false but returns true:
function truthCheck(collection, pre) {
  var check = true;
  collection.forEach(function(item, index){
    if (!item.hasOwnProperty(pre) || [null, undefined, 0, "", NaN].indexOf(item[pre]) > -1){check = false;}
  });

  return check;
}

truthCheck([{"single": "double"}, {"single": NaN}], "single");
Gyeognphil Choi
@creativeworkers10

I'm coding "Factorialize a Number" at the moment, and the console gives me the right answers, but the challenge doesn't want to be finished.

var a = [];
var b = 1;
function factorialize(num) {
  for(var i = 1; i <= num; i++){
    a.push(i);
  }
  for(var j = 0; j < a.length; j++){
      b *= a[j];
    }
  return b;
}

factorialize(5);

Did I do something wrong? Please help!

Johnny
@jtan3
@creativeworkers10 try putting your var a and b inside your function
Gyeognphil Choi
@creativeworkers10
@jtan3 Oh, It worked! Thank you so much! Is this about global, local scope?
CamperBot
@camperbot
creativeworkers10 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:cookie: 456 | @jtan3 |http://www.freecodecamp.com/jtan3
Johnny
@jtan3
@creativeworkers10 yup
Gyeognphil Choi
@creativeworkers10
@jtan3 Guess I need to look it up again! Thanks again!
CamperBot
@camperbot
creativeworkers10 sends brownie points to @jtan3 :sparkles: :thumbsup: :sparkles:
:warning: creativeworkers10 already gave jtan3 points
Johnny
@jtan3
@creativeworkers10 https://forum.freecodecamp.org/t/factorialize-number-challenge/137745 someone explains in the link
iso
@iso1048
@jtan3 do you know what the issue is with my code above?
Johnny
@jtan3
@gothamknight im not good with the harder algos sorry
iso
@iso1048
@jtan3 no worries
Tom
@moT01
@gothamknight ([erp]meti!)fi
iso
@iso1048
@moT01 i don't get it bro
oh its reversed of something I had...
@moT01 i changed item.hasOwnProperty(pre) to what you said (!item[pre]) and it worked.....why did it work?
just1witness
@just1witness
@gothamknight Your using .forEach(), look into .every() instead.
Tom
@moT01
cause the one test that was failing had that property
just1witness
@just1witness
hint, it's excruciatingly simple. @gothamknight
Tom
@moT01
the value was just NaN
so your test found the key there, and my test searched for the value
if that makes sense
and a NaN value isn't a value - like undefined or false
just1witness
@just1witness
@gothamknight just for reference, here's how you use .every()
function truthCheck(collection, pre) {
  return collection.every(function(a){
   return a[pre];
  });
}
iso
@iso1048
ok i get that NaN is not a value, since it makes no difference if I have it in that array i had. But I do not understand why !item[pre] was able to identify NaN... @moT01 @just1witness