Call and Apply
Functions are objects. There probably the most primitive type in JavaScript. To show case this we will create an example working with scope. Don't worry yet if you still are having issues with understanding scope. Its one of these core features of a language that just suddenly click and when it does it all sits in place. We will delve more deeply in this course into the hearts of all programing languages – the scope and knowing always where you are or part of what object you are. By the end of the first session you will have a basic understanding of how scope works and how its important to always asses where you are.
As every function is actually on its own a type of object we can trigger two advanced functions called 'call' and 'apply'. Both functions are used to control and change the scope of the function. To understand what that means we first will understand what scope is and then we will see it in action in both these function object methods.
Ready to Level Up Your Skills?
Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!
Enroll Now for Free!