---
title: "Discussion on \"TIL #3: Early Returns/Guard Clauses in JavaScript (and React)\" | Hashnode"
description: "Discussion on \"TIL #3: Early Returns/Guard Clauses in JavaScript (and React)\". Early Return is a pattern that suggests we avoid nested if-else statements by checking the preconditions and return or throw as early as possible. Usually,"
url: "https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [TIL #3: Early Returns/Guard Clauses in JavaScript (and React)](https://nsblog.hashnode.dev/til-3-early-returnsguard-clauses-in-javascript-and-react?utm_source=hashnode&utm_medium=feed)

Early Return is a pattern that suggests we avoid nested if-else statements by checking the preconditions and return or throw as early as possible. Usually,

Dec 14, 2021 · 1 min read · nsblog.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Navdeep Singh](https://hashnode.com/@navdeep)

@navdeep · Amritsar, India

  
[View profile](https://hashnode.com/@navdeep)

Full Stack Developer - JavaScript

I am a self taught web developer owning experience of 12+ years in web development field.

## Responses 6

Markdown supported · ⌘↵ to post

[Lorde Laura](https://hashnode.com/@lorde123)

[Sep 27, 2022](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/6332a92b4dd8b2344a76aefc)

Thanks for the information, [shellshockers.app](https://shellshockers.app/) I will try to figure it out for more. Keep sharing such informative post keep suggesting such post.

[Otis Jame](https://hashnode.com/@otis123)

[Sep 22, 2022](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/632c1cca318ff0fa18336b8d)

Early Returns/Guard Clauses in JavaScript [amongus2.io](https://amongus2.io/) (and React). Agenda In this article, we will go through the following sections: The basic concept of Early Return.

[Kane Lani](https://hashnode.com/@lanikane68)

[Sep 13, 2022](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/63204a6d6c86d75accc80c89)

I am very impressed with your articles, your content is very engaging and easy to understand. I have read many other websites but I still like your site. [moviedle](https://moviedle.io/) [quordle](https://quordlegame.io/)

[William Riley](https://hashnode.com/@WilliamRiley)

[Jul 20, 2022](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/62d7a427d3af5e3713d625c3)

Worth reading post. Thanks for the wonderful post. - [dissertation help service uk](http://www.eliteassignment.co.uk/dissertation-help/)

[felicia12](https://hashnode.com/@felicia12350)

[Jun 6, 2022](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/629da4d2cfa70a3fd32d9604)

amazing, this essay has a fascinating subject. [Slope](https://slopegame.io/) game is a fun game in which you try to get as near as possible to a moving ball while running at top speed. You can play it by yourself or with your friends. In no time, your heart will be racing and your adrenaline will be pumping.

[Ravinder Negi](https://hashnode.com/@ravindernegi)

[Dec 21, 2021](https://hashnode.com/posts/til-3-early-returnsguard-clauses-in-javascript-and-react/61b885320059f90a57a5860b/comment/61c1831d02755832385f581e)

it is really helpful. thank you for sharing
