QUESTION, ANSWER, EXPLANATION
This question has been asked by one of our members and a similar question could most likely be on the exam. All answers have been verified by MuleSoft certified FoMS experts.
Question
What is the correct syntax for a Logger component to output a message with the content of a JSON Object payload?
Answer
A) The payload is: $(payload)
B) #["The payload is: " ++ payload]
C) The payload is: #[payload]
D) #["The payload is: " + payload]
The correct answer to this question is C.
Explanation
In answer A, syntax with a dollar sign is wrong and the payload is not accessible that way. In answer B, there is a problem with a concatenation operator "++", which is a binary operator between same(!) data types and in this case the concatenation of a string and an object would be tried, which would lead to an error. In Answer D, there is an error with an addition operator "+", which naturally can not be used here, since addition as a mathematical operation has not been asked for. That leaves us with a correct answer C.
RELATED ARTICLES
OTHER ARTICLES
OLDER ARTICLES
LATEST FORUM UPDATES
APIAmeeth, Thursday, 1.9.2022 / 21:23
Jay-Catalyst, Tuesday, 2.11.2021 / 10:48
Matteo, Friday, 3.7.2020 / 16:30
Matteo, Friday, 3.7.2020 / 16:29
Matteo, Friday, 3.7.2020 / 16:28
Caio S Cavalcante, Friday, 22.5.2020 / 16:59
Edo Schatz, Thursday, 21.5.2020 / 13:50
Edo Schatz, Thursday, 21.5.2020 / 11:29
Edo Schatz, Wednesday, 20.5.2020 / 18:18
Edo Schatz, Monday, 18.5.2020 / 16:33
NEW ARTICLES
POPULAR ARTICLES