Saturday, June 12th, 2010

Optional Parameters

With JavaScript functions we don’t need to have a specific number of parameters to pass into a function. If we have situations where fewer parameters are required then we can set the JavaScript up to handle that simply by placing the mandatory ones first in the list and following them with the optional ones. JavaScript can go one better than that though since it provides a way handling the situation where you havw an unknown number of optional parameters. Whether you have no parameters at all or as many as someone takes the time to enter, JavaScript can handle it.

Optional Parameters

Tags: , , ,

Comments are closed.