Bind in javascript | chai aur #javascript

preview_player
Показать описание
#javascript #hindi
Sara code yaha milta h

Discord pe yaha paaye jaate h:
Instagram pe yaha paaye jaate h:
Рекомендации по теме
Комментарии
Автор

Mind blowing. I could never imagine this deep down lies the use case of bind() in JS and erstwhile React

thecalgarians
Автор

The day I will get a job...I am gonna share small stake of my salary with those youtubers who taught me programming and Hitesh Bhaiya is one of them.

blackopss
Автор

If someone is confused here is the summary, since we are calling this.handleClick and this here is button as console.log(this) gives, so button do not have handleClick access (that's why its coming as undefined ), so we have to explicit bind this to the class context (Which is React) to get the access.

Hope it is clear😀

sirdragoon
Автор

Indeed! We humans always tend to take things for free for granted. But here, let's not do that. He's putting his precious time and efforts just to teach us so that we may get a job. Let's share his videos everytime we see it in the feed!

DashinDanish
Автор

"In simple terms:

Without the bind method, an event listener only has access to the context (or this) of the element that triggers the event (like a button in this case). So, in your example, the handleClick event listener only has the button's context (this refers to the button itself).

Using the bind method, we can set the this context to a different object, allowing us to access the context where the event listener was created, not just the button's context."

wahajuddin-li
Автор

I'm 100% sure this is the best series of JavaScript on YouTube. Love you sir videos nhi rukhne chahiye or chai banti rehani chahiye

codebreaker
Автор

00:02 Introduction to the early days of React
01:28 Learning JavaScript basics for free on YouTube.
02:51 Discussing the creation and functionality of a class in React
04:31 Creating and handling button click events in JavaScript
05:57 Adding event listeners and handling button click events in JavaScript
07:26 Understanding button references and React methods
08:53 Explaining the use of 'BIND' keyword in JavaScript
10:19 Access to libraries and functions inside React

SarveshKumar-
Автор

I found an Interesting concept regarding 'this' that it does not overrides the content of 'this' in callback function:-
In JavaScript, the bind() method creates a new function that, when invoked, has its this value explicitly set to the value provided as an argument to bind(). It doesn't override this in the original function; rather, it creates a new function with a bound context.

gopishaw
Автор

let me explain if anybody has some confusion so remeber this line ""When used in event handlers, this refers to the element that triggered the event."" so here eventhough we create an instance of react class using new keyword and store that new created object in the app variable then that object is having server and library properties and handleClick() fn but when when we are calling the fn handle click inside addEventListener() then what happen is actually the element button is calling the function handleClick() so here this refers to the button element not the context of object created using class React so here It is priniting <button>...</button > but when we use bind() then we are actually binding the context of the object created using class React.Please like if you like my explaination....

shivamkaushik
Автор

Thank you Hitesh Sir for teaching such deep concepts and history of JS coding. Still hard to believe that we are getting this for free. I've done courses on Udemy, but nothing compares to your amazing videos! ❤

shreyakolekar
Автор

sir we love you dont say words like these low quality content you are best

amanrohilla
Автор

Best course of JS, No one teaches this much of depth. Thanks for the effort you have made.

namankatiyar
Автор

Thank you Hitesh and the whole team behind this beautiful JS course.

bibek
Автор

Excellent, very informative series. yeh to ap ka praim hae jo hum tk apna knowledge puhncha ry ho. Bundle of thanks hitesh bro

MuhammadMohsin-ub
Автор

You are the best teacher who provide all the paid content for free. Even the paid content doesn't provide so Deep knowledge as they only want to sell more and more courses. 🔥🔥🔥

Shubham_Gupta_ji
Автор

Sir I find ur Js series as the best in YT. Your tutorials gives insights of the topics which are not discussed much by others .
Lots of love and respect for ur hard work for helping us out by sharing ur knowledge
❤😄

shikharpandya
Автор

Such a sweet guy! 1:46
Keep the good work going Hitesh sir💪

shivanshupathak
Автор

Hitesh sir best teacher in my view

koi koi yhi java script 10000 NRI se pd rha ha

aur koi koi

koi koi yhi java script 25000 NRI se pd rha ha

aur koi lkhao dekr kisi me itna clear or basic stand ni jo ki sirf HITESH Sir me ha

Big Fan of HITESH sir

Code_Kingdom
Автор

Sir I am sure that no one can teach Js better than sir Hitesh, hats off to you sir, I followed your JS and now I am very confident in JS and can make the project which I want

Thank you soo much

hiddenmystery
Автор

best tutorial on JavaScript ever exist on earth. I think after spending a big amount of money for learning JavaScript, that also not comparable or even close to these tutorial.
Thank You sir..!

like please everyone

btech_Algorithm
welcome to shbcf.ru