Simple Arrow Function Using JavaScript

Arrow Function Multiplication, Arrow Function String, Arrow Function Length

Arrow Function Multiplication

Simple Arrow Function Multiplication of Two Numbers

let ArrowFunction = (a, b) => 5 * 7;
// Created a variable arrowFunction and initialized a ,b  
// in it and passing the parameters to the arrowfunction 

console.log(ArrowFunction());

Multiplication Output

35

Arrow Function String

Simple Arrow Function String

let ArrowFunction = () => "Hello World";
// Created a variable arroFunction and did not initialize any value
// in it and the parameter is being passed to the arrowfunction

console.log(ArrowFunction());

String Output

Hello World

Arrow Function Length

Simple Arrow Function Length

let country = ["India", "Pakistan", "Bangladesh", "Srilanka", "China"];
//Defined variable country and initialize array string value

console.log(country.map((country) => country.length));
//Defined variable country and passed some string values in it array
//called all strings via string.map
//Shows the length of all index values count word

Length Output

[ 5, 8, 10, 8, 5 ]