The name of a function is an identifier that follows the same rules as variable names. It must start with a letter or underscore and can be followed by any letters, digits, underscore character, single quote (apostrophe), and hyphens.
Apostrophes and hyphens must be followed by alphabetic characters. While apostrophes are not widely used in identifiers, hyphens are used quite extensively as they add an additional level of expressivity.
Below is a short list of examples of valid function names.
greet greet-them hello-world NumberOfItems is-valid to_be-or-not_to_be
Complete the quiz that covers the contents of this topic.
💪 Or jump directly to the exercises to this section.