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
Dardan Demiri
@dardandmr

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
Nicolas Ramirez
@kamatheuska
@sjames1958gm @latimercaleb I see....how can I access this.value in a property in the prototype? I want to do something line SomeConstructor.prototype.foo = 'someString'.repeat(this.value);
I need something like a setter...just guessing
alpox
@alpox
@kamatheuska yes you can use a property setter for this
Nicolas Ramirez
@kamatheuska
mmm not sure how, is there a set() method?
gonna check on MDN
thanks for the help! @alpox @sjames1958gm @latimercaleb
Abdullah
@AbdullahChaudhry
@kamatheuska
const SomeConstructor = function (value) {
  this.value = value
}

SomeConstructor.prototype = {
  foo () {
    return 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 2
@kamatheuska Because your foo was not a function
Calat
@latimercaleb
Does anyone else here struggle a bit with the algorithm questions? I usually find my own way of doing them without using the hinted functions, but trying to implement the hinted functions I never can find it out.
Dardan Demiri
@dardandmr
Usually the hints are a better way of solving algorithms, you can always do it on your way and you should but always check how you can do it better
Ken Haduch
@khaduch
@latimercaleb - I think that some of them are rather difficult. It's good to find a way to make it work on your own, but some of the hints and more advanced solutions are really amazing! I usually come up with something then find a better answer afterward. Rarely do I look at the provided solutions, though.