---
title: "Discussion on \"What are Pure Functions and Side Effects in JavaScript?\" | Hashnode"
description: "Discussion on \"What are Pure Functions and Side Effects in JavaScript?\". Pure functions and side effects are well-known concepts in functional programming. These concepts are widely used in JavaScript as well. Let's learn."
url: "https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3"
---

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

Discussion

# [What are Pure Functions and Side Effects in JavaScript?](https://blog.greenroots.info/what-are-pure-functions-and-side-effects-in-javascript?utm_source=hashnode&utm_medium=feed)

Pure functions and side effects are well-known concepts in functional programming. These concepts are widely used in JavaScript as well. Let's learn.

Dec 10, 2021 · 6 min read · blog.greenroots.info  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#programming](https://hashnode.com/tag/programming)
-   [#functional-programming](https://hashnode.com/tag/functional-programming)
-   [#codenewbies](https://hashnode.com/tag/codenewbies)
-   [#beginners](https://hashnode.com/tag/beginners)

## Written by

[Tapas Adhikary](https://hashnode.com/@atapas)

@atapas · Bangalore

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

Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human

## Responses 5

Markdown supported · ⌘↵ to post

[Ram Chandna](https://hashnode.com/@ram377)

[Mar 13, 2024](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/65f1ad3c0b563ef30db45669)

Wanted to ask something.... Is a method which reverses a "given" Number pure Or impure... Because according to me it is returning same value for same input so it should be pure.... But then there is an argument that it might be impure

[Tapas Adhikary](https://hashnode.com/@atapas)

[Mar 13, 2024](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/65f1ad3c0b563ef30db45669#reply-65f1f47c718bcc45ab034b99)

It's a pure function as long as it returns the same output for the same input. Btw, what did you mean by impure argument?

[bo kong](https://hashnode.com/@harwey)

[Jan 4, 2022](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61d4063b46e56e75ab3734ee)

讲的很透彻

[Tapas Adhikary](https://hashnode.com/@atapas)

[Jan 4, 2022](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61d4063b46e56e75ab3734ee#reply-61d4098b46e56e75ab37356a)

[bo kong](https://hashnode.com/@harwey), I don't know if this Google Translation is correct, but I wanted to tell you, "You are Welcome." 😃

不客气

[bo kong](https://hashnode.com/@harwey)

[Jan 4, 2022](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61d4055698628373c7a05d6e)

很棒帮哦

[Anamika Gupta](https://hashnode.com/@anamika)

[Dec 12, 2021](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61b648530059f90a57a55fe5)

Nice..very very helpful.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Dec 13, 2021](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61b648530059f90a57a55fe5#reply-61b789760059f90a57a57658)

Thanks a lot, Anamika ✌

[Maxi Contieri](https://hashnode.com/@mcsee)

[Dec 10, 2021](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61b36dd43e16b66b1b1e53ee)

Amazing Article !

We need more fundamental programming articles like this one !!

[Tapas Adhikary](https://hashnode.com/@atapas)

[Dec 10, 2021](https://hashnode.com/posts/what-are-pure-functions-and-side-effects-in-javascript/61b337498ef4ad168430e4e3/comment/61b36dd43e16b66b1b1e53ee#reply-61b36f1bb055806a4b00cf3a)

Thanks a lot [Maxi Contieri](https://hashnode.com/@mcsee) for motivating me.
