Questions
Take a moment to answer the following questions to serve as a recap of what you just learned in this chapter:
- How do you specify the DataWeave version inside a script if you’re using version 2.4?
- What operators can you use to add or remove values to/from an array?
- How can you define and call a global variable named
hello
of typeString
with the value"Hello World"
? - How can you define and call a global function named
sum
of typeNumber
that accepts two parameters (both of typeNumber
) and outputs the addition of both parameters? - Create a function called
order
of typeString
that accepts one parameter of typeString
calledoriginal
. Open a local context inside the function and create a local variable callednew
of typeString
that reversesoriginal
(hint: use selectors). In the body of the local context – inside the variable – create some logic to return the following strings:<original> goes after <new>
–...