...
Operators are syntactic sugar for normal function application. The left hand of the period (.) is inserted as the first argument of the function call. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
foo = function (self, arg1, arg2) { // `self` is the left hand side of `.` } // then use it "something".foo(1, 2) // which is the same as foo("something", 1, 2) // Another example: a.split(re#;#).length() // is the same as length(split(a, re#;#)) |
...