The above code follows the ES5 approach, with ES6 the same thing can be done in using single line of code and the code looks much more cleaner
Template literals are string literals allowing embedded expressions. You can use multi-line strings and string interpolation features with them.
Default parameters allow named parameters to be initialized with default values if no value or
undefined is passed.
Objects allow us to create a single entity that stores data items by key, and arrays allow us to gather data items into an ordered collection.
But when we pass those to a function, it may need not an object/array as a whole, but rather individual pieces.
Destructuring assignment is a special syntax that allows us to “unpack” arrays or objects into a bunch of variables, as sometimes that’s more convenient. Destructuring also works great with complex functions that have a lot of parameters, default values, and so on.
with ES6 the same code can be reduced and will bring readibility to your code
Classes in ES6