Ads 468x60px

Labels

Sunday, April 23, 2023

javascript interview questions and answers || call bind apply in javascript || Rohit Azad Malik

javascript interview questions and answers || call bind apply in javascript || Rohit Azad Malik

In this video, we will start by explaining what call(), bind(), and apply() methods are and how they work in JavaScript.
We will explore the differences between these methods, and you will learn when to use each method in your code. Additionally, we will cover some common interview questions related to these methods and show you how to solve them step by step. The video will be filled with code examples to help you better understand how these methods work in practice.
By the end of the video, you will have a solid understanding of call(), bind(), and apply() methods and feel more confident in your coding skills.

Ye JavaScript ke methods hain jo humein ek function ke this keyword ko set karne ke liye use kiye jaate hain.

Sabse pehle this keyword ke bare mein jaan lete hain. Jab aap ek object ke andar koi function define karte hain, to us function ke andar this keyword us object ko refer karta hai.
Lekin agar aap us function ko baahar nikal ke call karte hain, to this keyword global object window ko refer karega. Isiliye humein call, bind aur apply methods ka use karna hota hai.


call() method ek function ko call karta hai aur us function ke this keyword ko set karta hai. Aap call() method ko use karke, ek function ke arguments ko comma-separated list ki form mein pass kar sakte hain.

bind() method bhi ek function ke this keyword ko set karta hai, lekin wo us function ko call nahi karta hai. bind() method ek new function return karta hai, jiska this keyword set hota hai.

apply() method bhi ek function ko call karta hai aur us function ke this keyword ko set karta hai.
call() method ki tarah, apply() method ko bhi ek object se this keyword ko set kar sakte hain.
Iske alawa, apply() method ko arguments ko ek array ki form mein pass kiya jata hai.

Ummid hai ki aapko call(), bind(), aur apply() methods ke bare mein samajh aa gaya hoga.
Agar aapke paas koi aur sawaal hai, to aap poochh sakte hain.

Visit html css javascript tutorial in hindi with accessibility in - 2023 Playlist :-
Visit javascript tutorial in hindi - 2023 Playlist :-
Visit The Complete ReactJs Course - Basics to Advanced playlist :-
Visit Next.js Tutorials for Beginners to Advanced level 2023 in Hindi Playlist :-
You're welcome! We're glad you enjoyed the video. Your support and engagement are important to us and help us create more great content for you.
Remember to like, subscribe, share, and support our channel to stay updated on new and exciting content.

Thank you for the support! We appreciate your engagement and it helps us continue to create valuable content for you. Please follow us on social media for updates and new content.

YouTube Channel :- https://www.youtube.com/@azadMalikRohit
Twitter: https://twitter.com/rohitazad
Facebook: https://www.facebook.com/rohitazadmalik/
Stackoverflow: https://stackoverflow.com/users/1365428/rohit-azad-malik
LinkedIn: https://www.linkedin.com/in/rohitazad/
Github: https://github.com/rohitazad

0 comments:

Post a Comment