Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam MCD - Level 1 topic 1 question 62 discussion

Actual exam question from Mulesoft's MCD - Level 1
Question #: 62
Topic #: 1
[All MCD - Level 1 Questions]

A function named newProdCode needs to be defined that accepts two input parameters, an integer value for ItemID and a string value for productCategory, and returns a new product code.
What is the correct DataWeave code to define the newProdCode function?
A.

B.

C.

D.

Show Suggested Answer Hide Answer
Suggested Answer: C

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
chengl
Highly Voted 2 years, 12 months ago
A is correct. https://docs.mulesoft.com/mule-runtime/4.3/dataweave-functions
upvoted 30 times
Zumo
2 years, 11 months ago
Yes, you are correct. C gives a dataweave error. -> cannot be used. Most people will think because if '?' A is wrong. But A is the Correct Answer.
upvoted 5 times
...
...
Swoody77
Highly Voted 2 years, 7 months ago
The answer is A, as others have put, the -> symbols cannot be used in a function like this, only =.
upvoted 8 times
xasihih752
2 months, 3 weeks ago
You're right, as a general rule, lambda functions cannot be named
upvoted 1 times
...
...
ExamDev
Most Recent 3 months, 1 week ago
A is correct
upvoted 1 times
...
ExamDev
3 months, 2 weeks ago
A is correct.
upvoted 1 times
...
AntarJalil
4 months ago
Yep it is A. The only issue I saw on option A is that ""productCategory" is defined as "string" instead of "String" ( 's' instead of Capital S). However, if I also define a custom type (type string = String ) , it works fine . I just tried . so it is A the right answer .
upvoted 1 times
...
Pavankumar142
4 months, 3 weeks ago
A is correct
upvoted 1 times
...
Nazarii
1 year ago
A Correct
upvoted 1 times
...
MULEMADDY
1 year, 4 months ago
A is correct
upvoted 1 times
...
lelebc10baar
1 year, 4 months ago
A CORRECT ANS - syntax is right here
upvoted 1 times
...
Carolinek
1 year, 11 months ago
A is correct
upvoted 1 times
...
frediepulgoso
2 years, 2 months ago
A is correct
upvoted 1 times
...
mohammad_jani
2 years, 2 months ago
A is the correct answer
upvoted 1 times
...
maeda
2 years, 3 months ago
fun myFunction(param1, param2, ...) = <code to execute> its = cannot ->
upvoted 1 times
...
senthil_Kumar_Murugan
2 years, 5 months ago
A is the correct Answer we neeed to use "=" in function
upvoted 2 times
...
thamizhanda
2 years, 5 months ago
The answer is A, as '->' symbol is used in option C which is not a valid syntax in a function and it should be '='
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...