You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Variable number of parameters for javascript functions in OIC Library

in Integration 2 comments

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

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!