Answers for "how to use this inside arrow function"

3

arrow functions=>

// Traditional Anonymous Function
function (a, b){
  return a + b + 100;
}

// Arrow Function
(a, b) => a + b + 100;

// Traditional Anonymous Function (no arguments)
let a = 4;
let b = 2;
function (){
  return a + b + 100;
}

// Arrow Function (no arguments)
let a = 4;
let b = 2;
() => a + b + 100;
Posted by: Guest on December-31-2021
5

Arrow Functions

// The usual way of writing function
const magic = function() {
  return new Date();
};

// Arrow function syntax is used to rewrite the function
const magic = () => {
  return new Date();
};
//or
const magic = () => new Date();
Posted by: Guest on January-03-2021
0

arrow functions=>

params => ({foo: "a"}) // returning the object {foo: "a"}
Posted by: Guest on January-26-2021

Code answers related to "how to use this inside arrow function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language