JavaScript Question: What is a Decorator Function?

preview_player
Показать описание
If you have been around coding for a bit, you may have heard of decorator functions. Well what are they and how do we use them? We are going to answer those questions in today's topic.

Would you like to help keep this channel going?

Tutorials referred to in this video:

For more resources on JavaScript:

#javascript #AllThingsJavaScriptLLC
Рекомендации по теме
Комментарии
Автор

One of the best JS tutors out there. Thank you for everything that you do. :)

zbjptid
Автор

Your simple definition of this pattern helped me a lot. Thank you. I hope you continue to make videos, especially intermediate/advanced ones.

Videosuser
Автор

The decorator functions returns undefined now

You should have added:
return fn(...args);
In line 7

asemzk
Автор

I've been using these sometimes but didn't know they were called like that!

Rudxain
Автор

Can you show practical examples on how to use this?

Also, is there a difference between the two:

const something = function () {};

function something() {}

astigmatik
Автор

I didnt know this was a thing! now I gotta think up clever ways to use this! thanks.
Theyre like functions on functions instead of data...meta functions. right?

irlshrek
Автор

Think a more practical example would be useful.

ScottL