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
rdollent
@rdollent
or or or you can do a .filter
array.filter(function(obj) {
obj.type = "this type";
});
array.filter(function(obj) { obj.type = "this type"; });
array.filter(function(obj) {
  obj.type = "this type";
});
that will spit out an array
that you've to store in a variable
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "refund";
});
result;

:
{orderid: 5, type: "refund"}
John
@flyboy1565
what would happen an orderid doesn't exist in there?
what would the ouptut be?
rdollent
@rdollent
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "refund";
});
result[0];
{orderid: 5, type: "refund"}
you can put that in the google chrome console
it will say undefined
var array = [{'orderid':4, 'type':'sale'}, {'orderid':5, 'type':'refund'}];
var result = array.filter(function(obj) {
  return obj.type === "xxxx";
});
result[0];

undefined
John
@flyboy1565
perfect thanks for the help @rdollent
CamperBot
@camperbot
flyboy1565 sends brownie points to @rdollent :sparkles: :thumbsup: :sparkles:
:cookie: 337 | @rdollent |http://www.freecodecamp.org/rdollent
rdollent
@rdollent
actually it will output an empty array
i did the result[0] just to show you the first element in the result array
John
@flyboy1565
that'll still work i'll check if length == 0
rdollent
@rdollent
uhhuh for sure
John
@flyboy1565
thanks again
rdollent
@rdollent
also do length === 0 always use strict === not ==
AbrisM
@AbrisM
@AbrisM
Hi everyone
Is there a networking channel available on GITTER?
Ben Hart
@Benjmhart
hey folks, anyone in here have experience with d3 force charts?
Frank Bono
@frankbono
Quick question. Do I need to learn ES6 before learning React?
Tiago Correia
@tiagocorreiaalmeida
would help in quite a few stuff
Stephen James
@sjames1958gm
@frankbono Well, React uses es6 classes and arrow functions are useful
Frank Bono
@frankbono
@sjames1958gm Ok, I'm on it. Thanks man!
CamperBot
@camperbot
frankbono sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9058 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
@frankbono good luck!
Tom
@moT01
@Benjmhart whats the problem - youre best to just say what the problem is
neovks
@neovks
hey, I have an issue since last night can't figure this out... I'm on the portfolio project, and I've set up a clickable thumbnail to access a project but when I try to put it in a row the border suddenly get huge and I don't know why, if someone have an idea (it's the twitch thumbnail at the bottom)... thanks
Gulsvi
@gulsvi
@neovks It's in a row currently and the border doesn't look huge - maybe I'm misunderstanding
neovks
@neovks
aye it's in a row and the border isn't supposed to be that huge width wise, it's back to normal if I delete the row so that's weird
Gulsvi
@gulsvi
@neovks I think you may have more luck using a bootstrap card:
      <div class="row">
        <div class="col-4">
          <a class="btn" href="https://twitch.tv" target="_blank">
            <div class="card bg-dark text-white p-1">
              <img class="card-img-top" src="https://is1-ssl.mzstatic.com/image/thumb/Purple118/v4/6f/49/45/6f494545-6815-ff9b-eaf4-22b0e843070a/TwitchAppIcon-1x_U007emarketing-85-220-0-6.png/246x0w.jpg">
              <h3 class="card-title mt-4">twitch</h3>
            </div>
          </a>
        </div>
      </div>
The reason why it's expanding out like that is because it's in a col-4 which is meant to be 33% the width of the row. You have some additional CSS making it 200px wide by default.
col is meant to get wide/narrow depending on the size of the screen
neovks
@neovks
I see well I'll look into that then, thanks @gulsvi
CamperBot
@camperbot
neovks sends brownie points to @gulsvi :sparkles: :thumbsup: :sparkles:
:star2: 2640 | @gulsvi |http://www.freecodecamp.org/gulsvi
Eric Hasegawa
@EricHasegawa
Can anyone help me with the Simon Game project? Having trouble using the .focus() jQuery method
Ken Haduch
@khaduch
@EricHasegawa - do you have a link to your project, we can take a look...
Eric Hasegawa
@EricHasegawa
The issue is on line 71 of the js
Ken Haduch
@khaduch
@EricHasegawa - I don't know what's wrong with .focus() - but there might be something about the way you are using it. Still looking. IN the meanwhile, changing from.focus() to .click() makes the handler fire.
Eric Hasegawa
@EricHasegawa
@khaduch Yeah I'm working on it, I think I'm getting there
Ken Haduch
@khaduch
@EricHasegawa - yeah, it seems to be working now - at least I uncommented the code and tried the .focus() again and it changes the color... did you have multiple handlers set up, perhaps?