Ajay Yadav
Ajay Yadav

@ATechAjay

5 Tweets Jan 26, 2023
πŸ’‘ First-class citizens :
* It's not used in practice(during coding).
* It's a logical concept.
πŸ’‘ Higher order function:
* It's used in practice.
* It's a physical concept that can be coded.
πŸ’‘ Higher-order functions are only possible because of first-class citizen/function.
Here:
- addEventListener : higher-order function, because it takes the "callBackFun" function as an argument.
- callBackFun: this is known as a callback function.
πŸ’‘ A function that we pass as an argument to another function is called a callback function.
- We can return a function from another function because we treat a function in JavaScript as a value.
Here:
- The "welcome" function is a higher-order function because it returns an anonymous function.
- welcome("Hello") -> function
- welcome("Hello")("Ajay") -> function
πŸ”” Grab JavaScript CheatSheet in PDF file format for FREE.
That's all for now, we will meet in the next thread😍
πŸ”” Follow Me @ATechAjay
For:
🌐 Web Development
✨ JavaScript
πŸ“ Writing Skill
πŸ”₯ Motivation
πŸ’Ή Growth
β›” But Not For Only Resources & Shitpost 😁
Thank you so much for staying to the end of this threadπŸ’š

Loading suggestions...