FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Arrow Functions in JavaScript: A Simpler Way to Write Functions
NewsWeb Development

Arrow Functions in JavaScript: A Simpler Way to Write Functions

via Dev.to WebdevHiral1mo ago

Arrow function allow shorter syntax to write function in JavaScript They were introduced in ES6 to improve code readability Before arrow function: function greet(name){ return "hello" + name } After Arrow function const greet = (name)=>{return "hello" +name} const greet = name=> "hello" + name Syntax break down const functionName = (parameters) => { // code }; `- const → usually used to define arrow functions (parameters) → inputs => → arrow symbol {} → function body` Arrow function with one parameter const greet = name => "hello" + name if the function has only one statement that returns a value.You can remove the brackets and return value Arrow function with mutltiple parameter const greet = (firstname, lastname) => "hello" + firstname + lastname Arrow function with multiple parameter and multiple statement const greet = (firstname, lastname) => { let name = firstname + lastname return "hello" + name } with mutliple statement it is important to have bracket and return statement Arrow

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
13 views

Related Articles

Getting formal about quantum mechanics' lack of causality
News

Getting formal about quantum mechanics' lack of causality

Ars Technica • 3d ago

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day
News

From Moon hotels to cattle herding: 8 startups investors chased at YC Demo Day

TechCrunch • 3d ago

I Tried Claude Code…and It Completely Changed How I Write Code
News

I Tried Claude Code…and It Completely Changed How I Write Code

Medium Programming • 3d ago

News

Olemme ehkä oppineet integraalin väärin

Medium Programming • 3d ago

What Is the Best Garmin Watch Right Now? (2026)
News

What Is the Best Garmin Watch Right Now? (2026)

Wired • 3d ago

Discover More Articles