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
Marc
@MWBauer
So far as I know I'm not messing with anything else. Just the FCC and I've been walking through Deitel's Javascript for programmers book.
mstellaluna
@mstellaluna
@MWBauer codepen doesn't allow you to upload files unless you pay for pro service. BUT you can use a service like postimage.io that's free, you can upload your imgs and it give you the direct HTML link to them
Marc
@MWBauer
thanks @mstellaluna
CamperBot
@camperbot
mwbauer sends brownie points to @mstellaluna :sparkles: :thumbsup: :sparkles:
:cookie: 640 | @mstellaluna |http://www.freecodecamp.org/mstellaluna
mstellaluna
@mstellaluna
@MWBauer honestly its what I do for codepen, just postimage doesn't upload video files , images only
Lisa Copeland
@lisacopeland
use the export button at the bottom of your codepen to download a zip of your codepen to your machine
it will download a zip of your codepen project and you can unzip it into a local subdirectory
Then you can start visual studio and open the local subdirectory
You will see all of the files for your project - to run it just open index.html in chrome
Marc
@MWBauer
thx @lisacopeland
Lisa Copeland
@lisacopeland
no prob! After you get done editing your files you can try to create a github repo and commit the files!
Marc
@MWBauer
could someone take a look and help me figure out how to call the hr style?
Norvin Burrus
@ndburrus
@NJM8 when you complete projects, you submit them using codepen...
Xapuu
@Xapuu
Hey guys any idea for library like this one https://simplemde.com , but that is editing html, i need to emebd some text editor for generating e-mails in website
Nate Mallison
@NJM8
@ndburrus yes but who looks at them.
Ken Haduch
@khaduch
@mstellaluna - I just tried the generator, and it works great now if you change the direction, but now if you change the colors (without changing the direction) the selection of the new colors doesn't automatically generate a new gradient with the new colors. You aren't passing the gradDir value for the color change events, so I think that it's just generating some garbage value? I haven't fully debugged it, but that's what I see going on there.
@MWBauer - I forget what we were talking about, but dev tools are really helpful. At the bottom of the "Map" on the freeCodeCamp dashboard there are some videos that cover (in brief) use of the Chrome browser devtools - maybe a helpful intro if you haven't seen them? And I'm sure that there are more in-depth videos or documents on how to use it.
mstellaluna
@mstellaluna
@khaduch yea thats the next thing ibhad to figure out. I had several other bugs come up while getting the direction to work. Thanks for the suggesyion. Ill play around with it more.
CamperBot
@camperbot
mstellaluna sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3876 | @khaduch |http://www.freecodecamp.org/khaduch
Norvin Burrus
@ndburrus
@NJM8 i'm not sure who exactly reviews the projects... that's a good question. this just indicates that they are reviewed.
rk
@rajkumart08_twitter

Hi,

  • I am new to js.
  • I am analysing a simple code.
  • not sure how it works.
  • for the first time this line console.log("alphabet--->" + alphabet); is printing undefined counts[alphabet]--->undefined
  • can you tell me why its printing undefined.
  • for the second time its printing 3 at this line console.log(counts[alphabet] + 1);
  • but it should print two right since 1+ 1.
  • can you guys explain so that in future I can fix it myself.
  • providing my code changes below.

var str = "aaabbccccddd";
var arr = str.split("");
var counts = {};
for (var i = 0; i < arr.length; i++) {
    var alphabet = arr[i];
    console.log("alphabet--->" + alphabet);
        console.log("counts[alphabet]--->" + counts[alphabet]);

    if (counts[alphabet]) 
        {
            counts[alphabet] = counts[alphabet] + 1;
            console.log("inside if--->");
            //console.log("inside if--->" + counts[alphabet] + 1);
            console.log(counts[alphabet] + 1);
        }
    else
    { 
        counts[alphabet] = 1;
        console.log("inside else--->");
        console.log(counts[alphabet]);

        //console.log("inside else--->" + counts[alphabet] + 1);
    }
    //counts[alphabet] = counts[alphabet] ? counts[alphabet] + 1 : 1;
}

console.log('a: ' + counts['a'] + '\n b: ' + counts['b'] + '\n c: ' + counts['c'] + '\n d: ' + counts['d'])

output

alphabet--->a
counts[alphabet]--->undefined
inside else--->
1
alphabet--->a
counts[alphabet]--->1
inside if--->
3
alphabet--->a
counts[alphabet]--->2
inside if--->
4
alphabet--->b
counts[alphabet]--->undefined
inside else--->
1
alphabet--->b
counts[alphabet]--->1
inside if--->
3
alphabet--->c
counts[alphabet]--->undefined
inside else--->
1
alphabet--->c
counts[alphabet]--->1
inside if--->
3
alphabet--->c
counts[alphabet]--->2
inside if--->
4
alphabet--->c
counts[alphabet]--->3
inside if--->
5
alphabet--->d
counts[alphabet]--->undefined
inside else--->
1
alphabet--->d
counts[alphabet]--->1
inside if--->
3
alphabet--->d
counts[alphabet]--->2
inside if--->
4
a: 3
b: 2
c: 4
d: 3

CamperBot
@camperbot
njm8 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
Nate Mallison
@NJM8
@ndburrus Thanks. That gives some insight, I just wasn't sure if there is more feedback on your work. I think with the new beta curriculum they are trying to implement some automatic testing plugins, I have seen those around, pretty cool.
CamperBot
@camperbot
:star2: 2206 | @ndburrus |http://www.freecodecamp.org/ndburrus
Norvin Burrus
@ndburrus
@NJM8 ...sounds neat :sparkles:
A link for you to learn about! haha
Norvin Burrus
@ndburrus
@NJM8 wow, nice info... thank you :smile:
CamperBot
@camperbot
ndburrus sends brownie points to @njm8 :sparkles: :thumbsup: :sparkles:
:cookie: 401 | @njm8 |http://www.freecodecamp.org/njm8
Nate Mallison
@NJM8
@rajkumart08_twitter the first time it print undefined because that console log appears before you add the letter to the object, so there is nothing there so it returns undefined. It looks like your function is working as it should from the results
zootechdrum
@zootechdrum
have a front end question
i found this code that does what i want it to do but i cant understand why it does what it does
here is a link to my codepen
question is about the div and the *div in the css part . Why does the asterisk make it behave a different way than just putting top margin and bottom margin in the regular div
div{
  display:flex;
  border:solid red;

}
div *{
  margin-top:auto; 
  margin-bottom:auto;
}
why cant these two things be combined into one . I tried it and it stretches my button element and span element out
Nate Mallison
@NJM8
@zootechdrum I think maybe div *
is the same as div > * ? that means that code affects all the div's children, not the div itself
I'm not a css expert though
Daniel Simeonov
@dbsimeonov
div * I think selects all elements inside each div element ?
Nate Mallison
@NJM8
same as div > *
is child selector
oops
Ken Haduch
@khaduch
@mstellaluna - well you can probably just grab the text from the dropdown when the color change listeners are triggered and pass them in? Or maybe that doesn't work with an event listener?
I made a change in a copy of your pen where I put a slightly different function to be called as the callback for the color change listener, and that gets the directional text from the select element, and then passes that to the setGradient function.
Nate Mallison
@NJM8
>