Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Arrow Functions Examples For Blog Post
//Array of birthyear.
const years = [1992, 1978, 1986, 1995];
//Calculating age with a normal function.
var ages = function(yr) {
return 2018 - yr;
//Calculating age with an arrow function.
const anotherAge = => 2018 - yr);
//Arrow function example with single argument.
const multiply = number => number * 15;
//Arrow function example with multiple arguments.
const nameAge = (name, age) => {
console.log(name, age);
nameAge('Imtiaz', 22);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.