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
CamperBot
@camperbot
: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
I like the functionality, perhaps the style can be better
Works perfect
Calat
@latimercaleb
Yeah, I think so too. I've never been much of a designer, I think I'm going to rework sass into the css and maybe user materialize on it to get some more fancy UI. Then I'll submit and start the next one
Dardan Demiri
@dardandmr
Good idea ;)
Calat
@latimercaleb
Thanks @dardandmr
CamperBot
@camperbot
latimercaleb sends brownie points to @dardandmr :sparkles: :thumbsup: :sparkles:
:cookie: 285 | @dardandmr |http://www.freecodecamp.org/dardandmr
Clark Weckmann
@clarkhacks
@latimercaleb ios-esque, just something rounded, lots of gradients, not a lot of shadows. Something light for some quick prototypes. F7 works well but it's a bit heavy for my use.
Calat
@latimercaleb
Hmm I see, yeah I have no idea. But I wish you the best of luck. My knowledge of mobile is pretty darn small.
Nicolas Ramirez
@kamatheuska

Hey everyone, I am trying to access a property in a prototype and it isn't working:

const SomeConstructor = function (value) {
  this.value = value
}

Now, in the prototype, if I do:

SomeConstructor.prototype = {
  foo: this.value,
  zaz: 1,
  bar () {
    return this.zaz + this.value
  },
}

let obj =  new SomeConstructor(2);

console.log(obj.bar()); // logs 3
console.log(obj.foo);   // logs undefined

Why is that?

Stephen James
@sjames1958gm
@kamatheuska When you set foo for the prototype - this is a different value than when you run the function bar()
Calat
@latimercaleb
this.value doesn't have a value at the constructor level. It works for bar because it's a function