Reputation: 1
let test = () => { return true; }
becomes
var test=function(){return!0};
but I want to keep the arrow function (checking for ES6 support). How can I do this?
Upvotes: 0
Views: 363
Reputation: 14411
Transpilation is controlled by the language flags. You'll need --language_out=ECMASCRIPT_2015
(or higher) to keep arrow functions as that is the first Ecmascript version that supports arrow functions.
Upvotes: 2