3 ms·
Coffeescript has similar functionality. From the Coffeescript docs: OPERATOR = /// ^ ( ?: [-=]> # function | [-+*/%<>&|^!?=]= # c
by zyxley 13y ago
Coffeescript has similar functionality. From the Coffeescript docs:
OPERATOR = /// ^ (
?: [-=]> # function
| [-+*/%<>&|^!?=]= # compound assign / compare
| >>>=? # zero-fill right shift
| ([-+:])\1 # doubles
| ([&|<>])\2=? # logic / shift
| \?\. # soak access
| \.{2,3} # range or splat
) ///
When turned into Javascript it becomes:
var OPERATOR;
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;