How to create udf with parameters?

Amazingly, I’ve found nothing on such a basic topic. Can someone please show me sample code of a user defined function in wix javascript including parameter declarations with data types… ?

Thank you!

Hi, peter .

Do the following help:

WRT data types, keep in mind that JavaScript is a dynamically-typed, not statically-typed, language; as a result, you don’t declare variables with a type as you would in C, C++, Java and other statically-typed languages.

Thanks. Do I not have to declare the data type of a parameter?

Hi, Peter.

No, check out the links in my message and what I mentioned about the data type; since JavaScript is dynamically-typed, you do not declare the data type of a parameter (nor do you declare the data type of variables).

Here’s another link for you:

Thanks. Sorry, I must’ve missed your original explanation about that. Very much appreciate the help!