Тёмный

Bind in javascript | chai aur  

Chai aur Code
Подписаться 424 тыс.
Просмотров 56 тыс.
50% 1

Visit chaicode.com for all related materials, community help, source code etc.
#javascript #hindi
Sara code yaha milta h
github.com/hit...
Discord pe yaha paaye jaate h:
hitesh.ai/discord
Instagram pe yaha paaye jaate h:
/ hiteshchoudharyofficial

Опубликовано:

 

30 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 244   
@shreyakolekar4059
@shreyakolekar4059 11 месяцев назад
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! ❤
@blackopss017
@blackopss017 11 месяцев назад
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.
@theedit9028
@theedit9028 11 месяцев назад
Wow 🙏
@MohsinKhan-wv3ep
@MohsinKhan-wv3ep 10 месяцев назад
He don't wany your money , but the thing he may appreciate, which you can give is by achieving your goal and helping others to achieve their goal ❤
@sandeepswain6202
@sandeepswain6202 9 месяцев назад
Broo I have the same motive too . Let's go 😊
@manashvardhan9965
@manashvardhan9965 7 месяцев назад
Same
@vanshkumar-9042
@vanshkumar-9042 6 месяцев назад
What happened brother! Have you get the job?
@DashinDanish
@DashinDanish Год назад
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!
@sirdragoon4625
@sirdragoon4625 Год назад
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😀
@RohitChhabirajYadav
@RohitChhabirajYadav Год назад
chalo kahani sunte hai guys
@GAMERDHRUVSHORTS
@GAMERDHRUVSHORTS 5 месяцев назад
thank you sir
@BOSS55
@BOSS55 8 месяцев назад
thanks ji
@vaibhavsingh3453
@vaibhavsingh3453 8 месяцев назад
document .querySelector('button') .addEventListener('click', () => this.handleClick.call(this)); If we use call like this then it'll also work. I was so much consued about it and researched so much about bind and call. I almost got the clarity but i am still little bit confused but it's ok... 🤧🤧🤧🤧
@pratiksingh23
@pratiksingh23 8 месяцев назад
But, did you notice that if the button is clicked, it does nothing when "call" is used. Also, the button need not be clicked to produce that output that you are getting. It is because, the function this.handleClick.call(this) is not passed as reference as we have seen in the case of "bind". It is immediately gets executed as the constructor is called (how constructor is called -> when page reloads). Whereas, bind method just produces the reference for function to be called later point of time by binding this to the passed argument to the bind function. That is why, as soon as the page reloads it prints the same output as this.handleClick.bind(this). Button has no reference to execute a function. Basically it has undefined. addEventListener also doesn't generate error as it got undefined (return value of handleClick()).
@vaibhavsingh3453
@vaibhavsingh3453 8 месяцев назад
@@pratiksingh23 bro, using call like this just works exact same as bind. And my code is working properly and button as well. Because using call() immediately executes the function that is why I have wrapped it in another arrow function, so that it doesn't get's executed immediately as we load it into the browser. If you don't wrap this .call() method like I did, only then it will create such problem that you mentioned. If you want to pass that function as reference and also you don't want to use bind. You can write it this way: "()=>{this.handleClick.call(this)}" It works just same as using bind like this: "this.handleClick.bind(this)" At the end of the day it depends on your choice what syntax you prefer. But obviously bind is more commonly used in even handling so if you want your code to maintain some industrial standards then you'll have to follow the preferred way. Hope it gives clarity! Thanks! 😊❤️
@vaibhavsingh3453
@vaibhavsingh3453 8 месяцев назад
​@@pratiksingh23bro, using call like this just works exact same as bind. And my code is working properly and button as well. Because using call() immediately executes the function that is why I have wrapped it in another arrow function, so that it doesn't get's executed immediately as we load it into the browser. If you don't wrap this .call() method like I did, only then it will create such problem that you mentioned. If you want to pass that function as reference and also you don't want to use bind. You can write it this way: "()=>{this.handleClick.call(this)}" It works just same as using bind like this: "this.handleClick.bind(this)" At the end of the day it depends on your choice what syntax you prefer. But obviously bind is more commonly used in even handling so if you want your code to maintain some industrial standards then you'll have to follow the preferred way. Hope it gives clarity! Thanks! 😊❤️
@akshayjain2777
@akshayjain2777 Год назад
Thanks sir jii ❤‍🔥 your efforts are priceless ✌ such a deep content you are giving free. What a man you are sir jii
@ayushrajput6108
@ayushrajput6108 3 дня назад
Thankyou Hitesh sir I got new things best teaching about javascript learned much cj's concepts easily 🎉
@akroyalmaker
@akroyalmaker 4 месяца назад
Like for a masala tea☕☕
@SarveshKumar-08
@SarveshKumar-08 10 месяцев назад
00:02 Introduction to the early days of React 01:28 Learning JavaScript basics for free on RU-vid. 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
@pulsation3767
@pulsation3767 Месяц назад
one doubt sir, actually in line 20 of ur code, while giving handleClicked refrence, why we didn't put parenthesis while calling like document .querySelector('button') .addEventListener('click',()=>{ this.handleClicked() //--> without using bind, able to get the value. })
@RayanTanzeem
@RayanTanzeem 8 месяцев назад
Thank you so much sir 💚
@manishchandane6017
@manishchandane6017 11 месяцев назад
thank you so much sir 😊
@vaibhavsingh3453
@vaibhavsingh3453 8 месяцев назад
Thank you sir 🙏❤️
@gopishaw111
@gopishaw111 9 месяцев назад
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.
@ronakTV12
@ronakTV12 Месяц назад
Thank You SIr
@ano3000nymous
@ano3000nymous Месяц назад
In the line "this.handleClick.bind(this)" the first 'this' refers to the React class as the function 'handleClick' is in the React class and the function reference in the event listener is also being written in the React class. The 'this' parameter in the bind method also refers to the context of React class as it will be used by 'handleClick' method to log out the server property of React class. Is this right?!?
@shikharpandya4927
@shikharpandya4927 11 месяцев назад
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 ❤😄
@Shubham_Gupta_ji
@Shubham_Gupta_ji 7 месяцев назад
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. 🔥🔥🔥
@vipin143kumar
@vipin143kumar Год назад
Hello Sir 😘, ur tutorials hv been an invaluable resource 4 me n many others who r eager 2 learn n expand our knowledge. Ur teaching style is not only engaging but also incredibly effective. U've a unique talent 4 breaking down complex concepts into easily understandable parts, which has made learning so much more accessible. Thank You for Being an Amazing RU-vid Tutor 🙌
@mayanksinghrana4446
@mayanksinghrana4446 6 месяцев назад
Thank you, Hitesh sir, for your invaluable insights and deep understanding of JavaScript. Your expertise has been instrumental in enhancing my understanding of this language and has truly empowered me to become a more proficient developer. Your passion for sharing knowledge is inspiring, and I am incredibly grateful for the guidance you provide. Here's to continued learning and growth together.
@shyam_soni99
@shyam_soni99 8 месяцев назад
"Hitesh sir 's JavaScript series is a goldmine of knowledge, transforming beginners into proficient developers! 💡 ''
@BioChemAcademy
@BioChemAcademy 5 месяцев назад
just for comment purpose {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.}
@RohitRawat-ji6gh
@RohitRawat-ji6gh 7 месяцев назад
I just wanted to take a moment to express my sincere appreciation for all the hard work and dedication you put into teaching us it truly makes a difference in our learning journey. THANKYOU so much sir.
@vivekbhakhri735
@vivekbhakhri735 8 месяцев назад
19k view and still 1.7k likes why people don't have time to at least like and share but have time to share memes and scroll insta influencer, I just don't understand
@Usama-Tanoli
@Usama-Tanoli Год назад
console.log(quality === Chai aur javascript ); // output : true
@feelawesome251
@feelawesome251 6 месяцев назад
1:46 - sir aap toh Bihar UP mode m chal gaye 🙂 But thank you so much sir. for this wonderful course.
@jayashreedas5931
@jayashreedas5931 Год назад
Thanks, sir ji.....I bow to thee, a crore crore times..
@prasadtambde3894
@prasadtambde3894 11 месяцев назад
"Love the perfect blend of tech and tea on Chai aur Code! Engaging content and soothing vibes make it my go-to channel. Keep brewing knowledge!"
@AyushMishra-vd7im
@AyushMishra-vd7im 2 месяца назад
Sir when we are using bind it is getting the reference of this i.e all the properties defined inside the constructor but why the reference of the button is overwrite if button is calling then it will definitely show its reference
@ankitkumaryadav562
@ankitkumaryadav562 6 месяцев назад
In Class component mostly you get to see this "Bind" method. anyways, good content.
@RishirajDesigns
@RishirajDesigns Год назад
We appreciate your efforts sir 🙏
@sunnykumar9988
@sunnykumar9988 3 месяца назад
pease make under the hood playlist series for JavaScript
@utkarshdixit4611
@utkarshdixit4611 11 месяцев назад
Osm❤
@bibek2507
@bibek2507 11 месяцев назад
Thank you Hitesh and the whole team behind this beautiful JS course.
@sahdevdomadiya8665
@sahdevdomadiya8665 6 месяцев назад
sir bohut hi help mil rahi he thanks. please sir raect native pe bhi ek playlist bana dijiye.💗💗💗💗💗
@sunnykumar9988
@sunnykumar9988 11 месяцев назад
pease make under the hood playlist series for JavaScript
@Dev-Phantom
@Dev-Phantom 8 месяцев назад
cool
@thecalgarians4597
@thecalgarians4597 5 месяцев назад
Mind blowing. I could never imagine this deep down lies the use case of bind() in JS and erstwhile React
@harshsajla521
@harshsajla521 6 месяцев назад
❤💯
@sayannath2505
@sayannath2505 Год назад
i love this 😍😍😍😍😍😍
@shubhamrawat3649
@shubhamrawat3649 11 месяцев назад
Sir, I have a doubt what if we put arrow function in eventListener then also it works Document Button Click class React{ constructor(){ this.library = "React" this.server = "localHost" document.querySelector("button").addEventListener("click",()=>(this.handleClick())) } handleClick(){ console.log("Clicked"); console.log(this.server); } } const app = new React()
@Pokeball-z9f
@Pokeball-z9f 8 месяцев назад
Arrow functions automatically capture the this value from the surrounding scope, so there's no need for explicit binding.
@amit-gminggeek5301
@amit-gminggeek5301 2 месяца назад
i know sir you are doing a great work ....... #02:19
@VIPUL27
@VIPUL27 8 месяцев назад
Sir apke prem prem ke chakr me ye series maine 3 bar dekh dali😁
@SaadatGames
@SaadatGames 3 дня назад
big respect sir ❤💕👌
@rishavraj3127
@rishavraj3127 2 месяца назад
Thank you .....,😄😄😄😄😄😄😄😄😄😍😍😍😍😍😍😍😍😍😍
@atuljforce
@atuljforce 6 месяцев назад
Thank you so much sir for these videos.
@dsouzaedson
@dsouzaedson 10 месяцев назад
thoda confuse ho gaya mai, phir se dekhna padega
@kholaseerat2385
@kholaseerat2385 4 месяца назад
Whats the difference between call and bind
@kishan-74537
@kishan-74537 5 месяцев назад
thank you so much sir for this playlist
@SenseiVraj
@SenseiVraj 2 месяца назад
Free he par expensive knowledge he
@PratulMakar
@PratulMakar Месяц назад
Thank you very much sir chai ke sath☕
@sumitsinha995
@sumitsinha995 7 месяцев назад
content appreciation seh baad ke hai !!
@Jen_Gaming23
@Jen_Gaming23 Год назад
Loved this series. Very much appreciated sir❤️
@bibekedits1234
@bibekedits1234 8 месяцев назад
Appreciated sir love you sir
@rahamatshaikh8285
@rahamatshaikh8285 4 месяца назад
from lacture 1 to here .................😍
@aminhossainranju
@aminhossainranju 11 месяцев назад
thank you sir
@helloJs21
@helloJs21 6 месяцев назад
Best js tutorial thanku so much sir
@codewithsehran
@codewithsehran 3 месяца назад
1:46 I'll never gonna forget you ❤
@sunielsharma8142
@sunielsharma8142 Год назад
Sir form validation using js ❤❤
@chaiaurcode
@chaiaurcode Год назад
Agar DOM aata h, DOM se value pick krna bta diya, conditional and loops ho gye to validation me to bs logic hi h ki email check kro ya password format. Itna hi to krna h
@WatchNotchK2S
@WatchNotchK2S 7 месяцев назад
With all the respect, free toh hai but audience bhi sir best hai apki. Don't worry app jo bologe vo bilkul karenge....like share subscribe bhi karenge😅
@chaiaurcode
@chaiaurcode 7 месяцев назад
Ye to sab maante h, chai aur code pe sab serious coders h. Life me kuch krna chahte h aur uske liye serious mhnt krte h. Mujhe b full motivated rkhte h
@theamnaofficial_
@theamnaofficial_ 7 дней назад
Thanks for the series 😊
@Coder-rohits
@Coder-rohits 4 месяца назад
Sir aapke iss prem ko kabhi nahi bhul paunga.
@AbhishekChoudhary-p1h
@AbhishekChoudhary-p1h 8 месяцев назад
We appreciate your efforts sir 🙏
@hassanhameed7796
@hassanhameed7796 7 месяцев назад
Sir kya bataun.. bas Love ho aap
@namankatiyar5843
@namankatiyar5843 11 месяцев назад
Best course of JS, No one teaches this much of depth. Thanks for the effort you have made.
@satyamraj6800
@satyamraj6800 2 месяца назад
best video for bind sir..❤❤❤
@sandeepshresthasir
@sandeepshresthasir 3 месяца назад
Hindi mein aur clearly samajh aata hai!!
@wrongturn7865
@wrongturn7865 Месяц назад
Best js course ever in decades
@JTheSingingStrawHat
@JTheSingingStrawHat 4 дня назад
Aweeeeeeeeeeeeeeeeeesomeeeeee🎉
@tech_channel110
@tech_channel110 Год назад
sir data structure b sikhaye takay achay code likh sakay hum
@aggsha7580
@aggsha7580 Месяц назад
Thanks A Lot Sir ❤❤
@CheatCodePython
@CheatCodePython 12 дней назад
kar liya subscribe sir ji.
@anuraggupta1008
@anuraggupta1008 6 месяцев назад
high quality Js Series
@AnshuKushwaha-xz8di
@AnshuKushwaha-xz8di Месяц назад
this code is not working
@roshanp7256
@roshanp7256 8 месяцев назад
Thankyou sir keep it up ♥
@saptathirtachoudhury4158
@saptathirtachoudhury4158 5 месяцев назад
Hitesh Bhai is always the best
@BasharatFirdoos-ko4vd
@BasharatFirdoos-ko4vd 10 месяцев назад
are you among Illuminati
@riajikbal2938
@riajikbal2938 7 месяцев назад
Thanks sir you are so good
@kushagrapandey8898
@kushagrapandey8898 6 месяцев назад
Thank you so much sir ❣
@Instrumentation010
@Instrumentation010 8 месяцев назад
yes it was very interesting topic.
@riajikbal2938
@riajikbal2938 6 месяцев назад
Thanks sir for the series
@virajagarwal1714
@virajagarwal1714 3 месяца назад
only 6 videos left to complete my 1st ever course playlist on youtube.
@MohammedHasmi577
@MohammedHasmi577 5 месяцев назад
Thank you guruji❤
@surajbera1882
@surajbera1882 7 месяцев назад
Thank You So Much Sir♥️
@MightyYoutuber-mb7xd
@MightyYoutuber-mb7xd 5 месяцев назад
Amazing content💖💖
@surajgoraicse
@surajgoraicse 2 месяца назад
Sir , you are great.
@nikhatansari3310
@nikhatansari3310 11 месяцев назад
Thank you so much sir 😊
@bilal5488
@bilal5488 Год назад
sir haule haule😂 by the way thankew soooo much❤️
@chaiaurcode
@chaiaurcode Год назад
Aur aa rhe h 😂
@pratiksawant
@pratiksawant Год назад
​@@chaiaurcode😂
@priyankagehlot9945
@priyankagehlot9945 3 месяца назад
Thankyou Sir ❤
@BitFire007
@BitFire007 6 месяцев назад
"Chai aur Code, you're the mentor I wish I had when I started learning JavaScript. Incredible job!"
@relaxation_music-7ym
@relaxation_music-7ym 6 месяцев назад
Thank You Sir ❤❤
@tech_channel110
@tech_channel110 Год назад
shandar shandar lectures behtareen series behtareen video
@Hamza-Pro-Dev
@Hamza-Pro-Dev 2 месяца назад
1:47 Appreciated ☺
@Vikramsinghmertiya863
@Vikramsinghmertiya863 9 месяцев назад
Thanks a lot for the insightful javascript series on RU-vid! It has been incredibly helpful in enhancing my understanding of the language.
@JayveerPal-vq4be
@JayveerPal-vq4be Месяц назад
love this Series
@shivanandhatte
@shivanandhatte 10 месяцев назад
Thank you sir ..
@codebreaker8055
@codebreaker8055 6 месяцев назад
I'm 100% sure this is the best series of JavaScript on RU-vid. Love you sir videos nhi rukhne chahiye or chai banti rehani chahiye
Далее
Lexical scoping and Closure | chai aur #javascript
26:48
How to be a 10x Learner
17:41
Просмотров 98 тыс.
Class constructor and static | chai aur #javascript
26:36
Promise in javascript | chai aur #javascript
50:21
Просмотров 272 тыс.
Now you know fetch in javascript | chai aur #javascript
18:37
call, apply and bind method in JavaScript
10:50
Просмотров 468 тыс.