JavaScript · Middle · Question 67 of 75
What does options.onSuccess?.(data) do?
- ✓Correct answer: Calls
onSuccessonly if it exists; otherwise returnsundefinedwithout an error - 2Always calls
onSuccess - 3Checks whether
datais defined
Explanation
Optional call syntax is handy for optional callbacks. It still throws if onSuccess exists but isn't a function.