Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 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
Jordan Bourne
Looking at the docs for no-confusing-arrow here: https://eslint.org/docs/rules/no-confusing-arrow it seems like it would accept your one liner if there were some curly braces around the return statement, were you getting a separate eslint issue if trying that @Keggatron

@Keggatron Remove the semi-colon from the second example above to get rid of the unexpected token error:

const matchedArray = arr.reduce((acc, value) => (
  values.includes(value2) ? [...acc, value] : acc
), []);

Someone who hit the same problem as you has a discussion here: airbnb/javascript#1334

So, it seems with your current config, this would work:

const matchedArray = arr.reduce((acc, value) => values.includes(value2) ? [...acc, value] : acc, []);

Or.. if you have a 80-char width limit:

const matchedArray = arr.reduce(
  (acc, value) => (values.includes(value2) ? [...acc, value] : acc),
When you create sticky navbar should it be inside of wrapper
Shekhar Ramola
how to keep this loop running until the last satisfied condition?
 for (let i = 0; i < modifiedData.length; i++) {
                    const modified = modifiedData.filter(val => {
                      return val.reqnum == modifiedData[i].reqnum;
                    const passAssetCnt = modified.reduce(
                      (prev, cur) => prev + cur.passAssetCnt,
                    const totalAssetCnt = modified.reduce(
                      (prev, cur) => prev + cur.totalAssetCnt,

                    //    console.log((passAssetCnt / totalAssetCnt) * 100);
                    const percent = (passAssetCnt / totalAssetCnt) * 100;

                    //   return this.point.name + '<br>' + Math.round(percent) + '%';
                    return this.point.name + '<br>' + percent + '%';

@shekharramola what condition?
Shekhar Ramola
basically In the above code, i am trying to calculate the passAsset percentage for all the asset if their reqnum is same and it is all good if I do console.log(percent)
but when I am returning, I am not getting different values like in console
anyone here?
Morchid Chellali
Yes? :)

Hello, I have a question concerning css grid.
I am trying to make a navbar that's inspired by the following one.

My current try is this:

My layout is behaving quite differently to the one I posted. I would like to know how I can manage to keep my ulfixed inside the viewport and not moving, while everything else is scaling down. Do you guys understand what I mean here?? :)

I only want my h1 and h2 to move when scaling down...

scaling down as in responsive to size?
try using margins and absolute position to say the header or something
i don't see a difference between the site you put and your codepen
it looks the same when i reduce screen width. the only difference is when the width hits the media query width it doesn't look like the site you proposed.
but that just means, you need to style the css in your media query and you should be good to go

@zdman135 Hello, thanks for the help.
Yes exactly I mean reducing the screen width. :)

My problem here is that the body in the example page keeps it's left and right paddings when reducing screen width, whereas in my page the body loses the space on each site, as you can see by the border becoming one straight line.

I hope it's clearer for you now what I mean with the difference? :)

@bradley1492, do you mean something like this? https://codepen.io/anon/pen/NEBpRd?editors=1100 (link fixed)
@bradley1492 - when you reduce the screen size you'll see the <ul> follows on the lower right of header all the way until the <h1> starts getting covered
i just added another media query and took out the flex direction to column and made it row and use position: absolute; to <header> tag
if you wanna do exactly what Erin had, I would suggest re-crafting the boostrap class that does similar to that to your needs
Erin uses square space, and i'm sure they have their own css classes for that template that does exactly the navigation thing you're talking about
@bradley1492 - here check out this codepen. I basically did an example of what you can do. https://codepen.io/anon/pen/NEBpRd?editors=1100
At this point you just need to decide on the media widths and re-style the menu button. and you pretty much got the exact same thing as Erin on squarespace
and the bar. you probably don't want the gray bar if you're trying to match her site
I got it about 90% of the way there. I figured you can finish the rest, haha. let me know if that works for you. what I did. I hope I helped.

@zdman135 Hey, manyyyy thanks for that rebuild of the erin site nav part.

I'ts quite interesting to see how you solved the menu going up to the top here. I don't want to exactly make erin's


@zdman135 site. I more want to make a nav similar to hers but without the drop-up menu, if you can call it like that.
I hope I wasn't too unspecific with my initial problem that I had.
I thought on how I could have that big amount of padding on both sides at the beginning and then as I reduce the viewport-size get a have a fixed amount of smaller padding on both sides. But I think I figured it out now sort of like in this example:


@zdman135 menu-wise I somehow want to ditch a hamburger nav in favour of just the ul changing it's flex-direction.
@zdman135 What interests me with your example is if this would be your general workflow when seeing something that you'd like to replicate, like trying to get it done with bootstrap and then progress further from there? Would you then customize the bootstrap classes or write out your own css?
@zdman135 Like what exactly did you mean with "if you wanna do exactly what Erin had, I would suggest re-crafting the boostrap class that does similar to that to your needs"? :)
@bradley1492 - ohh, I didn’t realize you didn’t want your navigation to look exactly like hers. Haha
um, as far the bootstrap comment, nah, you don’t need to use bootstrap at all. it’s fine the way it is
I was just sayin the bootstrap thing, because I would have used it as it would have been easier to create the menu and the items in it using bootstrap. it’s not necessary.
it honestly depends on what i’m trying to do, whether i’d use bootstrap or not. but yes, generally if I use bootstrap. i would still have custom style sheets that may style over a specific bootstrap thing.

help guys, I'm trying to do this challenge : https://learn.freecodecamp.org/apis-and-microservices/basic-node-and-express/implement-a-root-level-request-logger-middleware

app.use((req, res, next) => 
  console.log(req.method + ' ' + req.path + ' - ' + req.ip);

I wrote this function, and it logs on the console exactly this

GET /favicon.ico - ::ffff:

when I test it, it seems working to me, but when I put the link of freecodecamp I get this:

// running tests
root-level logger is not working as expected
// tests completed
nvm resolved

@zdman135 yes I can once more only apologize for your time, I should have described in a more detailed way, what I am meaning.
Okay, because I sort of learned bootstrap a few weeks ago, but now I like css grid so much and I am unsure what to use.

Now I now CSS-Grid I don't really want to go back using bootstrap...
Hm now that I think about it a bit more, I think your work still helped me a lot in thinking again of in some way utilizing bootstraps nav classes... :)

Good evening,
I just wanted to know if anyone here is using bootstrap in combination with css grid??
I guess it's quite uncommon isn't it, to use some nav building classes from bootstrap and then the CSS-Grid for layouting?
@bradley1492 - it is hard to say what is common and what is not. considering there’s so many ways to do the same thing. just think of all the stuff you know as tools in your toolbelt.
as far as using css-grid for layout and bootstrap only for nav. yes that can be done.
and quite simple to do. if you wanted to set it up that way.
@zdman135 do you know how I could get myself into trouble doing things that way?
but, i don’t know if you know this or not. bootstrap comes with grid classes as well. so you can do all the same grid layout building as well with bootstrap
@zdman135 yes I had quite a bit of a play around with bootstraps grid layout but I just favor the css grid system. Honestly I am extremely torn apart between those two ways of building stuff. I just thought in the long run it would be better to build something nice without the usage of a third party library like bootstrap..
basically, think of bootstrap as this. people got sick of doing everything from scratch in css. so they just made bootstrap css classes allowing you to pick whatever lego blocks you need for building your UI without having to write the whole thing. can you do it yourself? of course you can.
the 3rd part library like bootstrap is honestly convenience nad preference