Thursday 12 July 2018

Arrow Function in JavaScript

Arrow Functions

Arrow functions allows a short syntax for writing function expressions.
You don't need the function keyword, the return keyword, and the curly brackets.

Example

// ES5var x = function(x, y) {
     return x * y;
}

// ES6const x = (x, y) => x * y;
Try it Yourself »
Arrow functions do not have their own this. They are not well suited for defining object methods.
Arrow functions must be defined before they are used. Using const is safer than using var, because a function expression is a constant value.
You can only omit the return keyword and the curly brackets if the function is a single statement.
It might be a good habit to keep them:

Example

const x = (x, y) => { return x * y };
Try it Yourself »

C# LINQ Joins With SQL

There are  Different Types of SQL Joins  which are used to query data from more than one database tables. In this article, you will learn a...