ES6 Arrow functions
See original GitHub issueHello,
My current project is stuck at ES5. I’m still using gulp 3.9 for the minification and ‘uglification’ of my JS code to generate the production files.
Because of this, I can’t minify/uglify jquery.flot.js. On line 976 there is a function called ‘addEventHandler’ which uses ES6 arrow functions.
Is it possible to change (back) the ES6 arrow function to ES5 anonymous functions…?
Like this:
eventList.sort(function(a, b) { return b.priority - a.priority });
and
eventList.forEach(function(eventData) {
eventData.eventHolder.unbind(eventData.event, eventData.handler);
eventData.eventHolder.bind(eventData.event, eventData.handler);
});
Instead of this:
eventList.sort((a, b) => b.priority - a.priority );
and
eventList.forEach( eventData => {
eventData.eventHolder.unbind(eventData.event, eventData.handler);
eventData.eventHolder.bind(eventData.event, eventData.handler);
});
This way, I’m able to uglify/minify the code.
Thank you in advance!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Arrow function expressions - JavaScript - MDN Web Docs
Arrow functions can have either a concise body or the usual block body. In a concise body, only a single expression is specified,...
Read more >JavaScript Arrow Function - W3Schools
JavaScript Arrow Function · Before Arrow: · With Arrow Function: · Arrow Functions Return Value by Default: · Arrow Function With Parameters: ·...
Read more >Arrow functions, the basics - The Modern JavaScript Tutorial
There's another very simple and concise syntax for creating functions, that's often better than Function Expressions. It's called “arrow ...
Read more >A Gentle Introduction to JavaScript Arrow Function
ES6 arrow functions provide you with an alternative way to write a shorter syntax compared to the function expression. ... In this example,...
Read more >Arrow Functions in JavaScript: Fat & Concise Syntax - SitePoint
The arrow function inside the .map() function develops over a series of statements, at the end of which it returns an object. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the npm package there is a dist/es5 folder containing the code you need
I completely understand this! Thank you!