Named Import Vs Single default export in modules es6

JavaScript has had modules for a long time. However, they were implemented via libraries, not built into the language. ES6 is the first time that JavaScript has built-in modules.
ES6 modules are stored in files. There is exactly one module per file and one file per module. You have two ways of exporting things from a module. These two ways can be mixed, but it is usually better to use them separately.

Multiple named exports

There can be multiple named exports:
//------ lib.js ------
export const sqrt = Math.sqrt;
export function square(x) {
    return x * x;
}

Let in Es6

let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used. This is unlike the var keyword, which defines a variable globally, or locally to an entire function regardless of block scope.

Variables declared by let have as their scope the block in which they are defined, as well as in any contained sub-blocks . In this way, let works very much like var. The main difference is that the scope of a var variable is the entire enclosing function:
function varTest() {
  var x = 1;
  if (true) {

Arrow Functions in Es 6

Es 6 has introduced new Arrow function. Let's first illustrate what an arrow function looks like, as compared to normal functions:
function foo(x,y) {
    return x + y;
}

// versus

var foo = (x,y) => x + y;
The arrow function definition consists of a parameter list (of zero or more parameters, and surrounding ( .. ) if there's not exactly one parameter), followed by the => marker, followed by a function body.
So, in the previous snippet, the arrow function is just the (x,y) => x + y part, and that function reference happens to be assigned to the variable foo.

Array Matching in Javscript

Array are objects in JavaScript. You can look at like this
var arr1=[1,2,3];
console.log(typeof arr1); //"object"
In javascript, comparing objects (incl. arrays) against one and other they are only compared by reference - i.e. arr1 == arr2 will only be true if they are the same array. Two separate arrays/objects that look the same are not compared by value.
To make it clearer; only the primitive values can be compared for equality - i.e. boolean, string, number. The special values null and undefined also act this way.
var arr1 = [1];
var arr2 = [1];
var arr3 = arr1;

Es 6 Destructuring assignment

Es 6 has new amazing feature Destructuring assignment. The destructuring assignment syntax is a JavaScript expression that makes it possible to extract data from arrays or objects into distinct variables.
var a, b, rest;
[a, b] = [1, 2];
console.log(a); // 1
console.log(b); // 2

({a, b} = {a:1, b:2});
console.log(a); // 1
console.log(b); // 2

Pages