Method definitions now require curly brackets, cannot be constructors

Published: | Categories: JavaScript


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.