This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Foo( a, b, c, d, e ){ | |
a = typeof a !== 'undefined' ? a : 0; | |
b = typeof b !== 'undefined' ? b : 0; | |
c = typeof c !== 'undefined' ? c : 0; | |
d = typeof d !== 'undefined' ? d : 0; | |
e = typeof e !== 'undefined' ? e : 1; | |
return (a + b + c + d ) / e; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Foo( args ){ | |
var a = 0; | |
var b = 0; | |
var c = 0; | |
var d = 0; | |
var e = 1; | |
if ( args['a'] ) a = args['a']; | |
if ( args['b'] ) b = args['b']; | |
if ( args['c'] ) c = args['c']; | |
if ( args['d'] ) d = args['d']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Foo( int a, int b, int c = 0, int d = 0, int e = 1){ | |
return (a + b + c + d)/e; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Foo( int a, int b, int c, int d, int e){ | |
return (a + b + c + d) / e; | |
} | |
void Foo ( int a, int b ){ | |
return Foo(a, b, 0, 0, 1); | |
} |