1

I have the following object and I would like to call it's function.

[{a:1, fn:function(){} }]

Now I know if the object would be nested ([{a:1, b:{fn:function(){} } }]) that I could do b->fn() but how do I do it when it's direct property of the first element?

I tried just SELECT fn() FROM ... but that gives Uncaught SyntaxError: Unexpected token , (so not a proper parser error).

Filip Kis
  • 1,650
  • 2
  • 14
  • 18

1 Answers1

1

Please use _ variable. This is a pseudo-variable, which includes the record whole itself:

SELECT _->fn() FROM ...

You can see this jsFiddle example.

agershun
  • 4,077
  • 38
  • 41