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
iso
@iso1048
oh true!
ok, then why does that test pass with both !item['single'] and item['single']? wouldn't the latter evaluate to false in the second object of collection?
Tom
@moT01
yes, but the first one wouldn't work
so the first one passes that test and sets it to false
iso
@iso1048
of course. I really am being an idiot. Thanks for all the help @moT01 (and sorry for wasting your time)
CamperBot
@camperbot
gothamknight sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 819 | @mot01 |http://www.freecodecamp.com/mot01
Tom
@moT01
im not doing much else
CamperBot
@camperbot
:cookie: 819 | @mot01 |http://www.freecodecamp.com/mot01
Markus Kiili
@Masd925
@gothamknight Method .every() would do the same as that flag variable and forEach. So it suits the problem well.
Mukesh Kumar Angrish
@MukeshAngrish
Hey guys, I need some help as my Tic Tac Toe app is not working properly. I have fairly good reasons to believe that is issue is with the minmax() function as I have tried running the app without using the minmax()function and it worked. Also I have some issue with the html/css maybe as the divs move from their location when I click on them.
Markus Kiili
@Masd925
@MukeshAngrish You have an error on the browser developer tools console.
Long Nguyen
@longnt80

@MukeshAngrish

some issue with the html/css maybe as the divs move from their location when I click on them.

I think this has to do with the line-height
I wouldn't use display: inline-block in this case
Try remove that and use float

a display: block element is easier to control its height
Long Nguyen
@longnt80
@MukeshAngrish ok here's the fix for your css issue:
add this to .col
vertical-align: middle;
but you should use float or flexbox for the layout
Marat
@Marat89bluolyu

hi all, i need return values from array with interval. I used setTimeout but function return undefined for all values:

function arrayCounter(arr) {
    for (var i = 0; i<arr.length; i++) {
        setTimeout (function () {
            console.log(arr[i]);
        }, 1000);
    }
}

arrayCounter([1,2,3,4,5]);

Whats wrong?

Markus Kiili
@Masd925
@Marat89bluolyu All those callback functions use the same variable i that has value arr.length at the time when those callbacks execute.
So arr[i] returns undefined.
Marat
@Marat89bluolyu
@Masd925 need to use bind?
Long Nguyen
@longnt80
@Marat89bluolyu try use let
Markus Kiili
@Masd925
@Marat89bluolyu There are many ways. One popular way is to make another function that makes the Timeout call and you pass the value of the index as an argument. Or what @longnt80 said.
Just remember that let is ES6.
Marat
@Marat89bluolyu
@Masd925 yep, but i need do it on ES5 =)
Markus Kiili
@Masd925
@Marat89bluolyu Then making that function is an easy solution.
Long Nguyen
@longnt80
Marat
@Marat89bluolyu
@longnt80 , @Masd925 thanks !!!
CamperBot
@camperbot
marat89bluolyu sends brownie points to @longnt80 and @masd925 :sparkles: :thumbsup: :sparkles:
:cookie: 533 | @longnt80 |http://www.freecodecamp.com/longnt80
:star2: 4441 | @masd925 |http://www.freecodecamp.com/masd925
Marat
@Marat89bluolyu
But in my code there is a problem. All values of my array are outputed at once.
I need that they a will be display with interval
 function arrayCounter(arr) {
    for (var i = 0; i<arr.length; i++) {
        (function (inner) {
            setTimeout( function() {
                console.log(inner);
            }, 1000)
        })(i);
    }
 }   

arrayCounter([1,2,3,4,5]);
Long Nguyen
@longnt80
@Marat89bluolyu I think you can do that with recursive instead of loop
Jim Tryon
@jimtryon
I think so too
Markus Kiili
@Masd925
@Marat89bluolyu Or use inner*1000
Long Nguyen
@longnt80
^
Mukesh Kumar Angrish
@MukeshAngrish
@longnt80 Sorry, I’m replying late. Thanks your
vertical-align : middle
worked for my Tic Tac Toe app. And about the float you mentioned, can you show me how to use it. I’ve never used that before in my css.
CamperBot
@camperbot
mukeshangrish sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 534 | @longnt80 |http://www.freecodecamp.com/longnt80
Long Nguyen
@longnt80
@MukeshAngrish can you give me the pen again
Mukesh Kumar Angrish
@MukeshAngrish
@longnt80 Here it is.
Long Nguyen
@longnt80
@MukeshAngrish ok here's a simple example of using float:
https://codepen.io/longnt80/pen/NvObYw
Markus Kiili
@Masd925
@MukeshAngrish Shortly put, a floated element is taken out of the normal flow of elements and put to the far right/left of the containing box. The element becomes a block-level element around which other elements can flow.
Mukesh Kumar Angrish
@MukeshAngrish
@longnt80 Ok, thanks. I understand it now. I will probably use it when I re-do my app
CamperBot
@camperbot
mukeshangrish sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:warning: mukeshangrish already gave longnt80 points
Mukesh Kumar Angrish
@MukeshAngrish
@Masd925 Yeah, got it now thanks
CamperBot
@camperbot
mukeshangrish sends brownie points to @masd925 :sparkles: :thumbsup: :sparkles:
:star2: 4443 | @masd925 |http://www.freecodecamp.com/masd925
Sofus Heggemsens
@Sofeo
can somone help me center the search resoults on my wikipedia viewer?
https://codepen.io/sofeo/pen/ayymja
heroiczero
@heroiczero