I was wondering, can you create a function with an optional parameter.
Example:
function parameterTest(test)
{
if exists(test)
{
alert('the parameter exists...');
}
else
{
alert('The parameter doesn\'t exist...');
}
}
So if you call parameterTest()
then the result would be a message "The parameter doesn't exist...". And if you call parameterTest(true)
then it would return "the parameter exists...".
Is this possible?