all groups > dotnet jscript > november 2007 >
You're in the

dotnet jscript

group:

what do the 'f' & 'o' do here ?


what do the 'f' & 'o' do here ? Justin Doh
11/27/2007 2:26:00 PM
dotnet jscript: I am still a novice in JavaScript, and I am trying to understand what is
going on with these parts. This is some portions of JS on the web form
calculations.
Any feedback is greatly appreciated.

My question is what do the ' f ' & 'o' do here??
---------------------------------------------------------------------------

function calculateForm( o ) {
if(o==null) return;
var f = '';
(typeof(o)=='object') ? f=o.name : f=o;
(f.indexOf('Break')!= -1) ? f='Break' : f='';
.......
var nEstablishedValue =
formatSignedDecimal(getValue('nEstablishedValue'+f));
var nDamage = formatSignedDecimal(getValue('nDamage'+f));
var nWriteDown = formatSignedDecimal(getValue('nWriteDown'+f));

setValue('nEstablishedValue'+f, formatSignedCurrency(nEstablishedValue));
setValue('nDamage'+f, formatSignedCurrency(nDamage).replace('$',''));
setValue('nWriteDown'+f,
formatSignedCurrency(nWriteDown).replace('$',''));
......

}


Re: what do the 'f' & 'o' do here ? Active Discovery Development
11/29/2007 10:06:56 AM

[quoted text, click to view]

From what i understand:

The "o" here is pass value or an object pass from the function who called it
and the "f" will be the container of what ever the "o" has..
i may be wrong but its what i understand..

AddThis Social Bookmark Button