Exam MCD - Level 1 All QuestionsBrowse all questions from this exam
Question 143

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?

    Correct Answer: C

    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.

Discussion
ExamDevOption: A

A. fun toUpper(username) = upper(userName)

Alandt

Agreed