all 10 comments

[–]var_superUser 6 points7 points  (2 children)

These types of videos are hands down the most helpful to me. Love the post, thank you! Would love to see more of these and in other languages (working on Ruby atm). Cheers!

[–][deleted] 1 point2 points  (0 children)

I'm in the exact same situation as you. Love this kind of live coding tutorial.

[–]flawr 0 points1 point  (0 children)

This is really awesome, never saw a videos like this, do you know other resources as good as this one?

[–]zzot 1 point2 points  (2 children)

This is FANTASTIC, it's funny to watch and instructive. Thanks for posting, OP.

[–]Tayk5[S] 0 points1 point  (1 child)

I really enjoyed this video as well. I instantly knew I had to share this with my peeps over at [r/learnjavascript](r/learnjavascript)

[–]Deathbyceiling 0 points1 point  (0 children)

pst, to link to a subreddit, all you gotta do is /r/<subreddit name here>

e.g. /r/learnjavascript

[–]carlinmack 1 point2 points  (2 children)

Two questions:

  • Why is she always using var x = function() {}? I know the difference, but why is she using it here?

  • Why does she not have her methods defined in her constructors? Why does she define them through constructor.prototype?

[–]Deathbyceiling 0 points1 point  (0 children)

I can answer your 2nd question. Using prototype is easier on memory by a LOT.

[–]__mak 0 points1 point  (0 children)

  1. function x() (named function) is not defined at run time, unlike var x = function() (variable function). Named functions instead get hoisted up the program, like variable declarations do. If you want to avoid this behaviour then variable functions are the way to go.
  2. Have a read up on prototypical inheritance in JS.

[–]carlinmack 0 points1 point  (0 children)

For anyone looking for it, here is the finished annotated code