0

I have encountered this notation shorthand in the array.reduce and object.sort functions in Sciter (http://www.terrainformatica.com/) :

array.reduce(:a, b: a + b)

object.sort(:a, b: a.start_time < b.start_time ? -1 : 1 )

I can pretty much guess what the parameters mean but I don't know for sure. How does this notation work?

Edit: Similar notation is used in Python. https://en.wikipedia.org/wiki/Anonymous_function

Alex.Gunning
  • 191
  • 11

1 Answers1

1

Apparently that's a lambda function syntax of the Sciter scripting language, which might be similar to JavaScript but is very different in this regard.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375