<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma" -->

---
title: Writing Clean Code in JavaScript | daily.dev
description: Using object destructuring makes the code much simpler and easier to understand. Use multiple input parameters instead of single object inputs. Arrow functions...
canonical: https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Writing Clean Code in JavaScript | daily.dev
og:description: Using object destructuring makes the code much simpler and easier to understand. Use multiple input parameters instead of single object inputs. Arrow functions...
og:url: https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma
og:image: https://api.daily.dev/og/posts/PZleetrma.png
og:image:alt: Writing Clean Code in JavaScript
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing Clean Code in JavaScript

**[Bits and Pieces](https://daily.dev/sources/bit)** · 5 min read · 154 upvotes · 7 comments

## Summary

Using object destructuring makes the code much simpler and easier to understand. Use multiple input parameters instead of single object inputs. Arrow functions provide a concise way of writing JavaScript functions. Use Template Literals for String Concatenations. Avoid the most popular way to express and handle nested functions in JavaScript 7.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.bitsrc.io/writing-clean-code-in-javascript-dd584bbe1874>

## Community discussion

Top comments from developers on daily.dev.

**@taitd153** · 0 upvotes

> Awesome!

**@evecreate** · 0 upvotes

> Is a good read indeed for things to keep in mind. I see a lot people switching to TypeScript but it's also good to keep the basics in mind.

**@guilhermevalle** · 0 upvotes

> Awesome article!

**@chameeradulanga** · 0 upvotes

> Good Article

**@daveyjake** · 0 upvotes

> It's a solid reminder of the "syntactic sugar" that ES6 provides.

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Writing Clean Code in JavaScript","url":"https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma"},"datePublished":"2021-11-10T01:14:35.872Z","dateModified":"2021-11-10T01:14:35.873Z","description":"Using object destructuring makes the code much simpler and easier to understand. Use multiple input parameters instead of single object inputs. Arrow functions...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/08872b0ad95f2fd2c1f2ce6297afb8ef","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/08872b0ad95f2fd2c1f2ce6297afb8ef","isAccessibleForFree":true,"articleSection":"Bits and Pieces","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Bits and Pieces","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/bit","url":"https://daily.dev/sources/bit"},"commentCount":7,"discussionUrl":"https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":154},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":7}],"keywords":"general-programming,javascript","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Bits and Pieces","item":"https://daily.dev/sources/bit"},{"@type":"ListItem","position":3,"name":"Writing Clean Code in JavaScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/writing-clean-code-in-javascript-pzleetrma","comment":[{"@type":"Comment","text":"Awesome!","datePublished":"2021-11-16T09:43:54.802Z","url":"https://daily.dev/posts/PZleetrma#c-tq-J4Nc8I","author":{"@type":"Person","name":"Trịnh Đình Tài","url":"https://daily.dev/taitd153","image":"https://media.daily.dev/image/upload/f_auto/v1626509645/avatars/A8FuEz7Bl"}},{"@type":"Comment","text":"Is a good read indeed for things to keep in mind. I see a lot people switching to TypeScript but it’s also good to keep the basics in mind.","datePublished":"2021-11-10T09:05:01.646Z","url":"https://daily.dev/posts/PZleetrma#c-V7q1efMhw","author":{"@type":"Person","name":"Eve Albers","url":"https://daily.dev/evecreate","image":"https://lh3.googleusercontent.com/a-/AOh14GhqNwxCpMIIjgpFXIrHPh7mLLdukpv3ArHaZi01wQ=s100"}},{"@type":"Comment","text":"Awesome article!","datePublished":"2021-11-10T12:57:23.953Z","url":"https://daily.dev/posts/PZleetrma#c-NHmUF72Z0","author":{"@type":"Person","name":"Guilherme Oliveira do Valle","url":"https://daily.dev/guilhermevalle","image":"https://avatars.githubusercontent.com/u/26411012?v=4"}},{"@type":"Comment","text":"Good Article","datePublished":"2021-11-14T08:58:28.348Z","url":"https://daily.dev/posts/PZleetrma#c-K46lWIOo3","author":{"@type":"Person","name":"Chameera Dulanga","url":"https://daily.dev/chameeradulanga","image":"https://lh3.googleusercontent.com/a-/AOh14Gi1yJOQZI8HoX8CZz48xK24nqxR1yhvrOoCsQmv5w=s100"}},{"@type":"Comment","text":"It’s a solid reminder of the “syntactic sugar” that ES6 provides.","datePublished":"2021-12-08T21:32:58.564Z","url":"https://daily.dev/posts/PZleetrma#c-HUbwqACNq","author":{"@type":"Person","name":"Davey J","url":"https://daily.dev/daveyjake","image":"https://media.daily.dev/image/upload/f_auto/v1639070226/avatars/874bb553db944825b839069e8fd7f972"}}]}
```

