JavaScript call() apply() bind() Methods In 90 Seconds #JavaScriptJanuary

Channel:
Subscribers:
296,000
Published on ● Video Link: https://www.youtube.com/watch?v=rZc7_2YXbP8



Duration: 1:41
27,661 views
866


Watch the entire #JavaScriptJanuary series from the beginning!
https://www.youtube.com/playlist?list=PLkwxH9e_vrALlH7D0XLDn2td-uoHqHFxq

In JavaScript the call(), apply(), and bind() methods can be used to assign an object to the “this” keyword.

The first argument is the object being assigned. Then we can pass in more arguments. These will then be used by the function.

The apply() method is similar to the call() method. The only difference is that the call() method takes arguments separately and the apply() method takes arguments as an array. So when working with arrays you would want to use apply().

There are other interesting things we can do with apply(). For instance, JavaScript arrays do not have a max() method. So if we have an array of numbers and we want to get the maximum value we could use apply().
Since we are not assigning anything to the “this” keyword, so we just set that to null then pass in our array.

The bind() method creates a new bound function, which wraps the original function object. So we are essentially creating a new function bound to the object. Then we call the function along with our arguments.

I'll be releasing a new video every day in January! Stay tuned..
_____________________________________

📚 Learn to CODE in just a FEW months here:
Treehouse Discount Code: https://treehouse.7eer.net/codeSTACKr
_____________________________________

🛠️ Tools I use:
🟠 Theme: https://marketplace.visualstudio.com/items?itemName=codestackr.codestackr-theme
🟠 Font: STACKr Code (Exclusive to my VS Code Course - https://vsCodeHero.com)
🟠 SuperHero Extension Pack: https://marketplace.visualstudio.com/items?itemName=codeSTACKr.superhero-extensions

🚢 Deploy for FREE on Vercel: https://vercel.com/ambassadors/codestackr
_____________________________________

💖 Show support!
PayPal: https://paypal.me/codeSTACKr
_____________________________________

Watch Next:
Web Development - Beginners Roadmap (2020) - https://youtu.be/iogabydg2y0
Playlist: Web Development For Beginners - https://www.youtube.com/watch?v=Ez4yHS2dsN8&list=PLkwxH9e_vrAJ0WbEsFA9W3I1W-g_BTsbt
_____________________________________

Connect With Me:
Website: http://www.codestackr.com
Twitter: https://twitter.com/codeSTACKr
Instagram: https://instagram.com/codeSTACKr/
Facebook: https://facebook.com/codeSTACKr
_____________________________________

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

#JavaScriptJanuary #31Days31Videos #codeSTACKr







Tags:
JavaScriptJanuary
31Days31Videos
JavaScript
JS
Web Development
Web Dev
Web Development 2020
Web Dev 2020
HTML
CSS
Node.js
Chrome
ES6
ES7
javascript call
js call
javascript call method
js call method
js call function
javascript call function
javascript apply method
js apply method
javascript apply
js apply
javascript apply function
js apply function
javascript bind
js bind
javascript bind method
js bind method
javascript bind function
js bind function