Hi, I’ve changed your thread title to describe your problem more clearly. Descriptive titles, such as “Why does my function return undefined?”, are more likely to elicit helpful responses than generic titles, such as “Help please”.
Also, for future posts, please include information in the Tell us what’s happening section, as you have not actually asked anything in this post…