A function named toUpper needs to be defined that accepts a string named userName and returns the string in uppercase.
What is the correct DataWeave code to define the toUpper function?
A function named toUpper needs to be defined that accepts a string named userName and returns the string in uppercase.
What is the correct DataWeave code to define the toUpper function?
The correct DataWeave syntax for defining a function uses the 'fun' keyword followed by the function name, the parameters in parentheses, the '->' arrow, and the function body. Therefore, 'fun toUpper(userName) -> upper(userName)' correctly defines a function named toUpper that converts the input string to uppercase and returns it.
A. fun toUpper(username) = upper(userName)
Agreed