Arrow functions in JavaScript

Since their introduction arrow function have simplified how we declare functions in JavaScript arrow functions are similar to lambadas in kotlin programming language
Instead of writing a function as
function time (param){
You can simplify code by rewriting it as simply
let time (param) =>  {
Alternatively you can use a neatier syntax
let time = param =>
Arrow functions this context does not refer to their scope.

For further reading "learn es6 the dope way part ii arrow functions and the this keyword",


Popular posts from this blog

How to set content disposition header for nginx server to force content download

Animated daylight on HTML5 Canvas

How to make a static http server in nodejs using express

JS13K Preparation

Adding Gameover and introduction screen on HTML Canvas