Drag Drop ES6

The following code demonstrates drag drop functionality in ES6.

Demo

Loader ES6

The following is the implementation of a simple Javascript (ES6) loader.

Demo

Add Events ES6

In the example below, we create a button and attach a click event to it.

Demo

Debounce (ES6)

Sometimes, we would like to wait a certain minimum time period before successive method calls. For example in events like onscroll(), onresize(), this can go a long way in terms of optimizing the page performance as a whole.

The wrapping the methods using a Debounce method is a simple way to achieve the desired result.

Demo