...
Code Block | ||
---|---|---|
| ||
(function(moduleName,$,window,undefined){ … }( window.moduleName = window.moduleName || {}, jQuery, window, undefined )); |
Here's an interesting article about that
...
To use ES6 in the client-side, use http://browserify.org/ or https://webpack.js.org/ .
Drupal is adopting it: https://www.drupal.org/node/2809281
OOP
The following example is ES5, ES6 has Classes. http://es6-features.org/#ClassDefinition
...