---
title: "Discussion on \"Short-circuiting in Javascript\" | Hashnode"
description: "Discussion on \"Short-circuiting in Javascript\". Logical operators in Javascript are used to combine two boolean values. But there are many more things that we can do with them, especially with the AND and the OR operator. One of those things is known as short-circuiting. \nIn this article, we will ..."
url: "https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b"
---

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

Discussion

# [Short-circuiting in Javascript](https://isaac-junior.hashnode.dev/short-circuiting-in-javascript?utm_source=hashnode&utm_medium=feed)

Logical operators in Javascript are used to combine two boolean values. But there are many more things that we can do with them, especially with the AND and the OR operator. One of those things is known as short-circuiting. In this article, we will ...

Jan 2, 2022 · 5 min read · isaac-junior.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#clean-code](https://hashnode.com/tag/clean-code)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Isaac Okoro](https://hashnode.com/@Isaac-Junior)

@Isaac-Junior · Port-Harcourt

  
[View profile](https://hashnode.com/@Isaac-Junior)

Human, Writer, Developer, Student

## Responses 4

Markdown supported · ⌘↵ to post

[Elena Kazakova](https://hashnode.com/@N0vum)

[Jan 5, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d5a3d79d96c307e0a28ce8)

It was helpful, thanks! It would be great to know what are the pros and cons, the differences between this approach and the 'if' or ternary operator.

[Ankur Tyagi](https://hashnode.com/@TheAnkurTyagi)

[Jan 3, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d305d62850417068a1a660)

Great read [Isaac Junior](https://hashnode.com/@Isaac-Junior)

[Isaac Okoro](https://hashnode.com/@Isaac-Junior)

[Jan 4, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d305d62850417068a1a660#reply-61d49a9a220e9879776698be)

Wooaaahhh

Thanks a lot. Means a great deal from you sir

[Hamza Khattabi](https://hashnode.com/@Marmooz)

[Jan 2, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d2094d0413645f5c7be6d6)

Nice article Isaac.

I use this in Solidity as it helps reduce gas fees.

Hope reading more of you.

[Isaac Okoro](https://hashnode.com/@Isaac-Junior)

[Jan 4, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d2094d0413645f5c7be6d6#reply-61d49a46220e9879776698b1)

The goal this year is to pick up solidity and transition into web3 and I'm glad you found the article useful

[Gift Uhiene](https://hashnode.com/@Giftea)

[Jan 2, 2022](https://hashnode.com/posts/short-circuiting-in-javascript/61d1b6560cfc5655c184665b/comment/61d1b8d90cfc5655c18466b6)

Awesome read
