Yes, functions in JavaScript are objects, so you can define properties for them.
function myFunc() {}
myFunc.property = 'value';
console.log(myFunc.property); // 'value'
Tags: basic, JavaScript, functions
URL: https://www.tiktok.com/@jsmentoring/photo/7456170349391023393