0

Can Anyone expain please why did we write ": [ ] " in line 10

Can Anyone explain please why did we write ": [ ] " in line 10. I believe it is the simplest way to write but what exactly is this, can anyone give another example of this to understand please?

Praveen Behera
  • 444
  • 2
  • 8
  • 17

1 Answers1

0

you need to look at lines 9 and 10 together. It's just a ?: conditional operator.

If there are errors - use helper function (it probably flattens various error messages, page level, field level, duplicate rules etc) to get 1 simple error message.

Else return an empty array.

eyescream
  • 18,088
  • 2
  • 34
  • 46