JavaScript Prototype Fun

preview_player
Показать описание
A few fun patterns I commonly do with JavaScript. Such as making the new keyword optional when creating instances, defaulting arguments and method chaining.

Рекомендации по теме
Комментарии
Автор

After watching all your videos I can say you are a very skilled javascript developer and I learned from you. You understand how javascript works on a deep level. However, the code you write would be harder to debug for other developers that are not as skilled as you are. That shows how skilled you are compared to many other developers. However, it can also lead to problems with maintaining the code.

christopherstephens
Автор

Your tutorial actually cleared up question related to options = options || {};. Thank you for that. Question though, I'm working in/with a CRM, and they've used underscore js and backbone js. Small piece of code:
{
_.extend(Abc.prototype,
info: null,
player: null
}

_extend.() = copies the properties of the object literal
Not sure why the coder would do Abc.prototype and not add a property name such as, Abc.prototype.propertyName. Wonder if you knew what Abc.prototype would mean?

Chris-scrx
Автор

Great tutorial, very helpful! Thanks!

hoads
Автор

Builder pattern isn't nearly this simple :) Thanks for the video though!

noherczeg
Автор

@4:50 You said "We wanna make sure options is always an object..." and went ahead and type options = options || {}
But what if what I pass to constructor is say string "STRING" It's not an object, so you cannot be sure that after this line options = options || {}, it will be an object...
How do you go around that?

lisplisp
Автор

Which Atom theme and syntax package is that? =)

AbinavSeelan
Автор

Dear Kyle,
Many of us viewers have poor eyesight and cheap computers. Please enlarged the font size two to three times. Thank you in advance.

basalduat