JavaScript Tutorial

  1. Javascript variable scope
  2. Arrow Function
  3. Function programming in JavaScript to perform an operation (map, filter, reduce )on collection or an array.
  4. Javascript an Array function – (splice())

Javascript Project:

  1. To bill status – learning (add/delete of bill item local storage, window.addEventListener [keypress code 13])

Arrow function:

ES6 has introduced arrow functions. First, they have a concise syntax. Secondly, they have implicit returns, which allows us to write these nifty one-liners.

Advantage:

  1. An arrow function simply inherits this object of its parent instead of binding its own, so we don’t need to specify binding of this keyword.
  2. Arrow function allows implicit returns, no need to write return keyword, as result, we have shorter syntax and no binding of this
    Traditional method have return values as
    
    let sum = function(x, y) {
        return x + y;
    }
    
    Arrow function without return keyword
    let sum = (x, y) => x+y;