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
Gulsvi
@gulsvi
if it's true, it breaks the loop, else remove the first element and check again
aRtoo
@artoodeeto
if it will hit break then it will go outside the if else statement
Gulsvi
@gulsvi
I wouldn't use break; there - it isn't necessary
aRtoo
@artoodeeto
if it will continue why dod we need to use for lopp?
Gulsvi
@gulsvi
You need to check all the elements in the array - that's what the for loop is for
aRtoo
@artoodeeto
shift will just remove the first element right?
Gulsvi
@gulsvi
Yeah, just the first one
aRtoo
@artoodeeto
yea but arr[0] is hard coded
Gulsvi
@gulsvi
After your shift() the first element off the array, arr[0] has a different value. It's pointing to the new first element, previously the second element
aRtoo
@artoodeeto
we can just use. arr,shift then if we just need to return the modified array right?
Gulsvi
@gulsvi
you still need to pass a value to func()
aRtoo
@artoodeeto
ohh. so for the first loop if its false then it will go shift? so the array [0,1,0,1] will be 1,0,1 and if its true it will break then goes out the loop and goes to return arr?
Gulsvi
@gulsvi
True, yes
aRtoo
@artoodeeto
ohh. right. we need the loop because if the orignal array is [0,1,0,1] . it goes to the shift with a new value of the array [1,0,1]. and since n === 1 true it will break. im i right? @SkyC0der
Gulsvi
@gulsvi
@artoodeeto Yes, exactly
aRtoo
@artoodeeto
@SkyC0der ohh. thanks dong!! mwah. ill cook sinigang for you bro.
CamperBot
@camperbot
artoodeeto sends brownie points to @skyc0der :sparkles: :thumbsup: :sparkles:
:star2: 2509 | @skyc0der |http://www.freecodecamp.com/skyc0der
Gulsvi
@gulsvi
:yum: lol
aRtoo
@artoodeeto
@SkyC0der i got chu fam! haha
Gulsvi
@gulsvi
Taratitat ka talaga ;)
Charot!
aRtoo
@artoodeeto
@SkyC0der tanginaaaaa pinoy ka talagang hayoffff ka! hahahaha
@SkyC0der pinoy ka ampottttssss malapit na ma ubos english ko. hahaha
Gulsvi
@gulsvi
lol, no entiedo, solo hablo un poquito de pinoy :)
aRtoo
@artoodeeto
@SkyC0der nope. hahaha. wagka na. di ako naniniwala sayo tol. pinoy ka. marnunong ka lng mag spanish.
Gulsvi
@gulsvi
lol, you'll never know :)
aRtoo
@artoodeeto
@SkyC0der hahaha. alam ko tol. hahaha. una palang mahilig mag change ng profile pic ang pnoy. haha
iso
@iso1048
@SkyC0der can I pm you.
Pagnito
@Pagnito
@SkyC0der yo
Bryan Jay B. Panesa
@bryanpanesa
@artoodeeto hahahaha mosquito ka daw
cumibulat
@cumibulat
Hi guys, i'm working on twitch api project. What is the best approach to refresh the ui after get all callback from the api ?
rafaelmonroy
@rafaelmonroy

hey guys I am trying to solve “where do I belong” with his code

function getIndexToIns(arr, num) {
 var newArray = arr.push(num).sort;
 arr.sort();
 var lowestIndex = 0;
 for (i=0;i<arr.length;i++){
   if (arr[i] <= num){
     lowestIndex = arr[i];
   }
 }
 return arr.indexOf(lowestIndex);
}

getIndexToIns([3, 10, 5], 3);

it seems to work for 5 out of the 7 arr and num they call for, but it wont work for the other 2, including the arr and num im calling for in this code.
can anyone suggest anything? I dont understand why is not returning 0 index, the other ones work just fine.

rafaelmonroy
@rafaelmonroy
nvm guys! got it fixed :)
lol
Chris Cullen
@123xylem
Hi.

MY thumbnails are squeezing out into weird places.. Can you see why?
``` <ul class="work ">

  <li><a class="thumbnail" href="https://codepen.io/123xylem/pen/jrAKPN" target="_blank">Simon Game <img class="projectImg" alt="Simon" src="http://www.yesthisgame.com/wp-content/thumbs/custom/S/simonsays.jpg" ></a></li>

  <li><a class="thumbnail" href="https://codepen.io/123xylem/pen/bZkAKd" target="_blank">Calculator<img alt="Calc"  src="http://i.huffpost.com/gen/1433050/thumbs/o-SIMPSON-MATH-facebook.jpg"</a></li>

</ul>

.work li{
  margin:2rem;
display:inline-block;
  float:left;
      max-width:700px;

   }
.thumbnail{
  max-width:300px;
  display:inline;
  border:1px solid black;
}
Amit Patel
@AmitP88
hey guys, I'm creating a tile map for a game I'm making and I was wondering, is it possible to use html Canvas in ReactJS? should it be used in this case or no?
Chris Cullen
@123xylem
Why are my work thumbnails squeezing out of the sides?
Long Nguyen
@longnt80
@AmitP88 yes, you can use canvas with react
Bryan Jay B. Panesa
@bryanpanesa
@123xylem what do you mean squeezing out of the sides?
Chris Cullen
@123xylem
@longnt80 thankyou it was squeezing out when i had class thumbnail in my <a> tag but no more
CamperBot
@camperbot
123xylem sends brownie points to @longnt80 :sparkles: :thumbsup: :sparkles:
:cookie: 519 | @longnt80 |http://www.freecodecamp.com/longnt80
Long Nguyen
@longnt80
@123xylem I didn't do anything though
Chris Cullen
@123xylem
@bryanpanesa oops thankyou instead
CamperBot
@camperbot
123xylem sends brownie points to @bryanpanesa :sparkles: :thumbsup: :sparkles:
:cookie: 237 | @bryanpanesa |http://www.freecodecamp.com/bryanpanesa