Method definitions now require curly brackets, cannot be constructors

Published: | Categories: JavaScript | Creative Commons BY-SA 3.0


Previously, curly brackets were not required in method definitions. Starting with Firefox 41, those are required as per the ECMAScript 6 specification and will throw a SyntaxError if missing. At the same time, method definitions can no longer be constructors except for generator methods.