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
Markus Kiili
@Masd925
If you just make side effects, use .forEach().
Stephen James
@sjames1958gm
        if (Array.isArray(el)) {
            final_array.push(steamrollArray(el));
        } else {
            final_arr.push(el);
        }
n1zzy
@n1zzy
@sjames1958gm now this one logs undefined values
hold on give me a sec... I'll try to re-write the code without recursion
Stephen James
@sjames1958gm
@n1zzy You aren't returning final_arr in the function
My bad, don't push the results of steamrollArray, that just re-creates the array.
You need to concat the result onto final_arr
final_arr = final_arr.concat(steamrollArray(el));
n1zzy
@n1zzy
@sjames1958gm yep that worked!
Stephen James
@sjames1958gm
@n1zzy Generally for recursion you resolve the answer on the return path, rather than with globals
n1zzy
@n1zzy
@sjames1958gm now I understand, this kinda confused me since declaring that variable locally seemed like a bad idea, but I didn't knew that FCC denied global variables
I think I tried once creating a separate function
Stephen James
@sjames1958gm
@n1zzy The issue is that the globals don't get reset between each test
alpox
@alpox
@n1zzy It does not deny them, its just the way global variables work which doesn't work with FCC
@n1zzy If you try multiple functioncalls with the global variable version, you will also see that only the first call works
n1zzy
@n1zzy
aha now I understand
mstellaluna
@mstellaluna
is anyone online?
mstellaluna
@mstellaluna
I have to step away but need some help. I created a background linear-gradient generator and I can't get the values from my dropdown to be applied to the CSS. Not sure what I'm not seeing here. The pen is at https://codepen.io/mstellaluna/pen/pLmjjz
Ken Haduch
@khaduch
@mstellaluna - did you get it to work since the time you posted your question? It looks like it will set the colors if I select new colors, but not initially with the default colors that you set. But selecting a new color does work. I guess I should say that I'm using the Opera browser on Windows 10.
mstellaluna
@mstellaluna
@khaduch no i cant get it to go in the direction i select
If i check my DOM variables indiviually its fine
Ken Haduch
@khaduch
@mstellaluna - oh, I just figured that you were in the process and didn't do that. Just add a line similar to this in your setGradient function:
option = direction.options[direction.selectedIndex].text; to fetch the direction from the dropdown, because you don't have an event listener for that. Or add an event listener to trigger the function, but you still have to get the new value.
With that line to grab the new value before you set the body style, it will use it when a color change is made.
mstellaluna
@mstellaluna
@khaduch let me try that. Ill get back to you on it. Thanks!
CamperBot
@camperbot
mstellaluna sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3874 | @khaduch |http://www.freecodecamp.org/khaduch
mstellaluna
@mstellaluna
I was out of ideas tbh
n1zzy
@n1zzy

can someone please explain why

truthCheck([{"user": "Tinky-Winky", "sex": "male", "age": 0}, {"user": "Dipsy", "sex": "male", "age": 3}, {"user": "Laa-Laa", "sex": "female", "age": 5}, {"user": "Po", "sex": "female", "age": 4}], "age");

should return false ??!
https://www.freecodecamp.org/challenges/everything-be-true

is it because of the zero? shouldn't a number be negative to be false?
Markus Kiili
@Masd925
@n1zzy Only falsy number is 0.
Well, NaN is falsy also.
n1zzy
@n1zzy
oh ok... makes sense now, was confused 'cuz when I used array.indexOf() would always return -1 when nothing found, but would've made more sense if it returned 0... now I understand why we use array.indexOf() > -1
Ken Haduch
@khaduch
@n1zzy - but if .indexOf() returned 0 then it would indicate that your value was in the first location in the array. -1 isn't an array location.
n1zzy
@n1zzy
@khaduch thats also true :smile:
hensn5250
@hensn5250
@n1zzy do you have a codepen?
@n1zzy check your messages
n1zzy
@n1zzy
yes, why?
Adetunji Adegbite
@twonjee2002
thanks @n1zzy @ndburrus
CamperBot
@camperbot
twonjee2002 sends brownie points to @n1zzy and @ndburrus :sparkles: :thumbsup: :sparkles:
api offline
:star2: 2205 | @ndburrus |http://www.freecodecamp.org/ndburrus
Norvin Burrus
@ndburrus
@twonjee2002 you're welcome! enjoy :sparkles:
Marc
@MWBauer
@khaduch no i am not familiar with looking at the dev tools
Nate Mallison
@NJM8
I have a question about the front end cert, how do your projects get tested? I see the website makes sure have passed all the algorithm challenges, but does someone actually review your websites and make sure they meet the user stories?
Marc
@MWBauer
Visual studio is the same type of program as Codepen, just offline, right?
Lisa Copeland
@lisacopeland
@MWBauer visual studio is an editor for code - like microsoft word is an editor for documents
Visual studio lives on your computer with all of your code files
Marc
@MWBauer
oy.
Lisa Copeland
@lisacopeland
codepen lives on an internet site with your code files
Marc
@MWBauer
I hate that Codepen doesn't allow me to use local image files.
if it does, I'm doing something wrong.
mstellaluna
@mstellaluna
@khaduch had to do other tweaks to get it working and displaying correct but this is the final product gradient generator