Variable number of parameters for javascript functions in OIC Library
Summary:
I want to create a function in a javascript library where I don't have to use all parameters. I try to a create coalesce function which return the first non-empty/null value.
function coalesce(val1, val2, val3, val4, val5, val6, val7, val8, val9, val10)
When testing the function separately i can call it like this coalesce('', 'val2') and it will return 'val2'. But when I am using the function in OIC i have to provide empty string to all parameters which are not mapped to a input. Can I avoid this?
I havey tried to overload the function with variations with different numbers of parameters in the same js-file
Tagged:
0