Add [] syntax for JS functions