Use Javascript in textual rules

If I understand correctly, the default language of .rules files is Rules DSL, but it’s possible to write the rule in Javascript (JS Scripting).

But I can’t find documentation on how to declare Javascript as the language. Does anyone have an example file?

Thanks!

It is documented here

You save the file with .js extension inside conf/automation/js/

Thanks!