• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Functions > Creating a Function

Creating a Function

Creating a function is as easy as using the keyword function, providing a name for the function followed by a pair of parentheses for parameters (we discuss the topic of parameters in more depth later), and placing whatever code you want between two curly brackets. It looks something like this:

function myFunction(){
    //script to run in function
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint