What is 'this'

preview_player
Показать описание
Explain what "this" is in JavaScript #shorts

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

The concept “the less you know the better ” applies here

brandotcom
Автор

"This is bullcrap!"
"No, this is the window object"

Matt
Автор

Your "unless" just made me trip on THIS

anuragpatel
Автор

Value of "this" is always an object;
value of "this" not decided at the time you write code, it is decided when you run code.
value of "this" inside function is equal to the object who is calling your function.
and arrow function take "this" from its surrounding because they don't have own "this".
we can specify the value of "this" using call, apply or bind method.

Harshitvashisth
Автор

University teachers preparing questions for their JS course exams be like:

judai
Автор

As someone who primarily writes code in JavaScript, I can relate to this. And by "this", I mean the video, not the window object.

neilh.
Автор

People sitting beside me: What are you watching

Me: I am learning *this and that*

anonymouscoder
Автор

nothing to see here, just JS being JS.

darrorpsk
Автор

"This is bullcrap!"
"No, this is Patrick!"

pinkuchocobo
Автор

next time i'm writing js and someone says "hey check this out" i'ma have a stroke

justingolden
Автор

Kudos for actually filming the screen. Makes it easier to understand that it's not my screen!

kebman
Автор

I find it hard to believe that these "new" arrow functions were added to the standard all the back in 2015!

dnaiel
Автор

"So, what videos do you watch?"
Me: "Oh, this and that."

bryannaing
Автор

this is a certified Javascript classic

PeterusTV
Автор

Window be like: "Now THIS looks like a job for me... Now everybody, just follow me"

janherfs
Автор

1) "this" always refers to the nearest object. If no object is specified, it will refer to the window object.
2) const binds this as nearest object as this on default
3) Other example usage of "this":
function a(a, b) {
this.propA = a;
this.propB = b;
}
//"this" here will actually refer to the object that will be instantiated with the "new" keyword.
const b = new a(1, 2);
console.log(b.propA); //1
console.log(b.propB); //2

imiqar
Автор

Thanks for making "this" more complicated for me than it was before.

amit_awadhi
Автор

Very concise, I absolutely love these tutorials

chriscormier
Автор

You said "Unless" so many times that I am not sure reality is even real anymore. 😂😂👏👏👏

Kevin-jcfx
Автор

Basically, He's speaking Ruby code. if, unless ...

sha.
visit shbcf.ru