[JS/ES] Ann: Operator Overloading in ExtendScript
Copy link to clipboard
Copied
Hi everyone,
I recently discovered that ExtendScript allows you to extend/override operators. It's a pretty old feature but I had not paid attention until now.
For example, you can create a + operator to compute Array object the way you want, or a * operator to multiplicate a String by a number, etc. You can also create a complete set of friendly operators for a fresh new class.
You'll find some practical examples (including the prototype of a Complex class) on Indiscripts:
http://www.indiscripts.com/post/2010/05/operator-overloading-with-extendscript
I hope it will interest you.
Regards,
Marc
Copy link to clipboard
Copied
Marc,
You're a wild man!
You're treating ExtendScript like C++ or something...
Cool stuff! You scare me!
Harbs
Copy link to clipboard
Copied
Very interesting, Marc -- thanks.
Peter

