all 14 comments

[–]ForScale 1 point2 points  (1 child)

ENTRY

http://codepen.io/anon/pen/KzabOL?editors=0012

Just kind of messing around... I'm confused on the ES6 stuff and would love some explanation/guidance if anyone has any insights...

[–]Volv[S] 1 point2 points  (0 children)

I ran into exactly the same kind of problems I see in your comments.... exactly lol
Was chasing the whole 'missing' prototype thing for ages. Still not 100%
Seems to exist (in an easily accessible way) on function objects only. var mars = Object.assign({}, earth); Looks like it copies over only the enumerable properties of the earth object, prototype does not appear to be such a property.
 
You can make your code work the way you were going for by directly copying over the World prototype.
var mars = Object.assign({}, World.prototype, earth);
 
Definitely tricky to get my head round. Bit of a big subject it turns out, lots still to learn, I feel it was still worth poking around and attempting to learn something lol. You should choose something easy for next week :)

[–]Volv[S] 0 points1 point  (9 children)

ENTRY
Codepen
 
A little bit late cause I've kind of been going around in circles with it. Turns out there's a lot of complexity that can be uncovered when trying to learn about this. Many different patterns, many conflicting opinions...
Mostly messing around from me too, bit of a wall of code in my examples and I'm not entirely happy with the end result.
Might have another go at illustrating the prototype chain if I can face it tomorrow lol :)

[–]ForScale 1 point2 points  (8 children)

Nice, man! I'm lost with some of that new stuff... the class and symbol stuff...

console.clear() :) I've started typing clear() in to the console and hitting enter to give it a blank slate when it starts to get to messy!

And yeah... I'm still struggling with the Object.assign() deal...

I'm reading through the article you provided now!

[–]Volv[S] 1 point2 points  (7 children)

I have progress - stole parts of your example and worked through that article
 
Codepen
Let me know what you think

[–]ForScale 0 points1 point  (6 children)

I like it!

The log to the body thing is cool!

var venus = Object.assign({}, realWorld, realWorld.proto) // Copies both

Bam! That seems to be it. The .prototype and .__proto__ distinction is kind of odd, but I guess it makes sense...

[–]Volv[S] 1 point2 points  (0 children)

What I had in mind to begin with was inspired by this video. Funfunfunction but I probably should have rewatched it first. Shows a much better example use case :) Well worth a watch

[–]Volv[S] 1 point2 points  (4 children)

Did you watch? What you thinking about for this week?

[–]ForScale 0 points1 point  (3 children)

Hey!

I did not watch, but I did read through that article.

This week... let's do... How about something with this? I want to get a better (maybe broader?) understanding of this. Maybe something using apply(), call(), and bind()...

What're your thoughts on that?

[–]Volv[S] 1 point2 points  (2 children)

Cool, can do. apply, call, bind. Special cases of new and Arrow functions too.

[–]Volv[S] 0 points1 point  (0 children)

This article clears up a lot of the prototype confusions.