Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > ASP


Thread Tools Rate Thread Display Modes
Old 01-11-2017, 04:22 AM   #1
Registered User
Join Date: Dec 2013
Location: Banglore
Posts: 336
Send a message via AIM to chinmay.sahoo Send a message via MSN to chinmay.sahoo
Arrow Creating Functions with Default Arguments

JavaScript does not support functions with default arguments. In C++,these are the values supplied to the parameters in a function’s prototype.There are, however, ways you can “fake it” and make JavaScript behave as if it used default parameters. Calling the following function at the beginning of a function is a simple workaround you can use in JavaScript:

function checkDefault(parameter, defaultValue)
if (typeof parameter == "undefined")
return defaultValue
/* else */
return parameter
The appropriate call to this function is:

parameterName = checkDefault(parameterName, defaultValue)

Fat Cutter Powder | Asthi jivak | Fat Cutter
chinmay.sahoo is offline   Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
System Functions Applied to Strings chinmay.sahoo PHP / mySQL 0 10-07-2016 06:26 AM
Functions in .ASP wryfhk22 ASP 5 06-05-2015 05:53 AM
How to remove Android Default apps Rickyhose111 General Discussion 0 01-16-2015 01:18 AM
PHP including functions from another file. noahwilson PHP / mySQL 5 03-05-2014 01:54 AM
How to set up of custom html default error pages jennypretty Search Engine Optimization 1 01-03-2012 08:21 AM

All times are GMT -7. The time now is 06:03 AM.

Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.