This video is the first in a video series about how to do Object Creation in JavaScript. I will NOT be teaching object orientation principles in general – this video series is for you if you’re already pretty familiar with object orientation, but confused around how it works in JavaScript specifically. At the end of this series, you’ll be a lot less confused about the prototype, classes, bind, Object.create, modules, factories, constructors and so on.
Object Creation in JavaScript
https://goo.gl/KFeTFN
Higher-order functions in JavaScript
https://goo.gl/3aTDR6
Original source
26 responses to “bind and this – Object Creation in JavaScript P1 – FunFunFunction #43”
I am confused. We have an object. Object has a function already defined. Then I want to use that function like dog.talk in an event handler. Why am I using the object mentioned, then pulling a function out of it(dog.talk), and then binding same object to it? Seriously, who though of that? Is there a single advantage of that? Sounds to me like a very silly design of the language.
You have to understand this in order to avoid it as much as possible.
what the heck! you took too much time..i'm out……
Great, this video helped me understand it all. Thank you very much!!!
WARNING: At around 6:55 I was taking a drink of coffee and spit all over my keyboard. 🙂
how about making a 2nd video on "this"
sorry but this video is like watching Krusty the Clown teaching pre-school kids programming…
you don't need to be super serious or anything but this is just too cheesy with too much boring unnecessary talk
What are the disadvantages and advantages of using this compared to closures?
Today I learnt: JS is a bastard from Scheme and Java.
Oh man! thanks you saved me! lol! keep doing more videos!
let talkFuncton = function(){
console.log(this.sound)
}
talkFunction() //undefined
Please, correct me if I am wrong.
At this time, the function is sitting at the global context, and because of that, the this keyword is pointing to the global object (window object). It returns undefined, because the sound variable (this.sound) is created in the window object, but without a value (undefined). is It right? So, "this" on that context exists but it's point to global object.
For approximately the millionth time, I am so glad for your super goofy and smart and animated JavaScript tutorials.Thanks!
Thank you for the .bind() tutorial. It was helpful.
6:51 pretty much describes my entire web developer career
Incredibly helpful, THANK YOU!
Dude you're awesome! btw, are you using vim?
I have no idea where I can apply(in general) this stuff, like: oop, this, bind, etc. I have watched many tutorial about this stuff, but only I can see it's famous: 'firstname' and console.log(). Some advice? Thanks
'this' will be the button element on which event occurs and not the window object @13:41
What the fuck shit ass was exactly my first response to "this". Love the energetic way you present in your videos. Keep em coming!
Awesome
If we talking in a context of web browser, "this" keyword is pointing to the global object when you past the method of the object dog to the variable, in fact, if you create a variable call dog in the global context and then you pass the same method of dog to the variable, now the console show the value assigned to the dog variable in the global object, I don't know if my explanation was clear but that happens when you are not a great instructor and you native lenguage is not english 🙂
Its clearer to me if i think "bind scope to dog".
thank you pal, greetings from Guayaquil,Ecuador. Awesome , good work
wtfsa
A t-shirt waiting to be made!
if(function f() {})
{
console.log(typeof(f));
}
Can someone please explain what will be logged and why?
What The Fuck Shit Ass. Got to incorporate that into my vocabulary. ?