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
@dardandmr I get an alert "Bottom" every time I scroll to that section - I think the goal is to only fire the alert (aka, call the api) once
Maybe I'm misunderstanding the goal though, tbh
Dardan Demiri
@dardandmr
$(document).ready(function () {
 var apiCall = true;
    $(window).on('scroll', function () {
        var hT = $('.forks_me').offset().top,
            hH = $('.forks_me').outerHeight(),
            wH = $(window).height(),
            wS = $(this).scrollTop();
        if (wS > (hT + hH - wH) && window.location.pathname == '/') {
            if(apiCall){
               getApi();
            }
            apiCall = false;
            console.log('works')
        }  
    })
});
This fires once in a lifetime
:P
@NikolaNbgd
Try this
it's your code just with the One Time call
Matthew
@RoutinePoutine
Why does myArray.slice(0, 4); result in the first four entries rather than the first five?
Dardan Demiri
@dardandmr
var a = ['zero', 'one', 'two', 'three'];
var sliced = a.slice(1, 3);

console.log(a);      // ['zero', 'one', 'two', 'three']
console.log(sliced); // ['one', 'two']
NikolaNbgd
@NikolaNbgd
@dardandmr yeeeep, that is my solutuon! :) thank you man!
CamperBot
@camperbot
nikolanbgd sends brownie points to @dardandmr :sparkles: :thumbsup: :sparkles:
:cookie: 284 | @dardandmr |http://www.freecodecamp.org/dardandmr
Dardan Demiri
@dardandmr
;)
@RoutinePoutine
var a = ['zero', 'one', 'two', 'three'];
var sliced = a.slice(1, 3);

console.log(a);      // ['zero', 'one', 'two', 'three']
console.log(sliced); // ['one', 'two']
This is how slice works
Matthew
@RoutinePoutine
If 0 is 1, why isn’t 3 ...4?
Thanks for the response
Dardan Demiri
@dardandmr

because the slice() function

takes 2 arguments

First one is where to start,

The second one is where to stop

Matthew
@RoutinePoutine
It only cuts first and last ?
Why not stop at 3? If 3 is 4?
Does the second argument happen after 0 is no longer 1?
Dardan Demiri
@dardandmr
can you make an example

like this

[1,2,3,4,5,6].slice(1,2)

Matthew
@RoutinePoutine
function findLength(array)
Dardan Demiri
@dardandmr
yes ?
Matthew
@RoutinePoutine
return array.length;
Sorry
I mean functionFourItems(array)
Dardan Demiri
@dardandmr
yes
Matthew
@RoutinePoutine
return array.slice(0, 4);
Dardan Demiri
@dardandmr
it should return just 4 items right ?
Matthew
@RoutinePoutine
I thought it would be 0, 3
Yes
Does 4 imply 0 is no longer 1, but 2..so 4 is new 3?
Dardan Demiri
@dardandmr
[1,2,3,4,5,6].slice(0,4);
 0 1 2 3 ( 4 not included)
Dardan Demiri
@dardandmr
The second argument is never included
Matthew
@RoutinePoutine
Thanks
4 is protected?
Dardan Demiri
@dardandmr
Yes
always
Matthew
@RoutinePoutine
Thanks
Dardan Demiri
@dardandmr

and, for future thanks...

It's a better idea to mention the name by clicking on the name of the person who helped you, just to reward the helper...

Like this:

Thank you @RoutinePoutine

CamperBot
@camperbot
dardandmr sends brownie points to @routinepoutine :sparkles: :thumbsup: :sparkles:
:cookie: 109 | @routinepoutine |http://www.freecodecamp.org/routinepoutine
Clark Weckmann
@clarkhacks
I'm looking for a lightweight ios-esque css framework for a quick prototype, any recommendations? framework7 is what I'm using right now
Calat
@latimercaleb
Ios-esque? Now you've got me interested. What do you mean by that @clarkhacks
Calat
@latimercaleb
What do you guys think of this random quote generator? I think it meets all the requirements, i even got the query string with the twitter button to work https://codepen.io/latimeks/pen/VzdEoy
Dardan Demiri
@dardandmr
@latimercaleb Great