---
title: "Discussion on \"Introduction to Functional Programming\" | Hashnode"
description: "Discussion on \"Introduction to Functional Programming\". Pure Functions, Higher Order Function, Immutable Code"
url: "https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75"
---

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

Discussion

# [Introduction to Functional Programming](https://sayurikamble.hashnode.dev/introduction-to-functional-programming?utm_source=hashnode&utm_medium=feed)

Pure Functions, Higher Order Function, Immutable Code

Feb 23, 2021 · 2 min read · sayurikamble.hashnode.dev  
Updated Apr 27, 2021  
Read the article

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

## Written by

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

@sayurikamble · India

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

A young aspiring dev, sharing her knowledge and documenting the journey

Sayuri | Programmer Full Stack Web Developer. ReactJs Ecosystem.

## Responses 18

Markdown supported · ⌘↵ to post

[Limkre Breisa](https://hashnode.com/@singeinspector)

[Aug 8, 2023](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/64d2003197ca470130be981a)

I've been reading your blog. To be honest, I've never read anything like this before. [doodle jump](https://doodlegames.io/)

[Lomesh Badhe](https://hashnode.com/@lomesshh)

[Jan 8, 2022](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/61d9a8de3c89a32a868182d3)

Mindblowing Article ! 🔥

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Jan 8, 2022](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/61d9a8de3c89a32a868182d3#reply-61d9c4bfcda0d0294b69695c)

Thank you!

[Shubham Kumar](https://hashnode.com/@Shubhham)

[Apr 27, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6087be4da826f80aaefecc11)

Great work, Informative and helpful, keep it up

[Gabriel RomayMachado (he/him)](https://hashnode.com/@Wolfwood)

[Apr 27, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60879600a826f80aaefec721)

Hi! I love functional programming and your article is incredible!

Just a little feedback: I think that, on the 2nd code example ("Functional Way"), last line should be:`console.log(message("Sayuri"));`, right?

Just to be super clear to the reader about what pure functions look like :) the other examples are perfect

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Apr 27, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60879600a826f80aaefec721#reply-6087b145a826f80aaefecb03)

Thank You [Gabriel RomayMachado (he/him)](https://hashnode.com/@Wolfwood) for those kind words. It made my day.

Thanks for pointing it out. Made the required changes.

[Manigandan Ravi](https://hashnode.com/@manirsg16)

[Feb 28, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603b407d0dad7e6b99e209ec)

Hey first of all good explanation. But I don't understand why we should not iterate using for or while loops. Why you prefer map, reduce, filter etc,.

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 28, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603b407d0dad7e6b99e209ec#reply-603b45c99aeaec6b8ed540ff)

That's one aspect of Functional Programming. Map, reduce, filter are all functions. Which are short and clean to read.

For / while loops are long and difficult to read and also a bit hectic.

Let me know if you need more clarification !

[Manigandan Ravi](https://hashnode.com/@manirsg16)

[Feb 28, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603b407d0dad7e6b99e209ec#reply-603b4ffa9aeaec6b8ed54212)

Got it thanks..!! [Sayuri Kamble](https://hashnode.com/@sayuk)

[sumit kamble](https://hashnode.com/@sumeet007)

[Feb 25, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6037822515c9f056ec69c155)

Liked the way of explaining mutability :)

[José Torres](https://hashnode.com/@joseme)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603663020c99f77f2f8a5c63)

Good article! It makes me want to know more about functional programming. Thanks!

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603663020c99f77f2f8a5c63#reply-60368cad05efef7f0a9d3b8b)

Glad you found value !

[Chety](https://hashnode.com/@MereMala)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60365b140c99f77f2f8a5b8f)

In Mutation Bad section assignment operation must be done with index 1. Nice work by the way. const code= \[ "Javascript", "Python", "React" \] code\[ 1 \] = "Node"

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60365b140c99f77f2f8a5b8f#reply-60365dfa0c99f77f2f8a5be6)

Fixed it ! Nice Observation.

Thank You.

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603659a60c99f77f2f8a5b84)

Hope you Found Value. If you did, then It would mean a world to me if could give this article a upvote : [app.daily.dev/posts/lsRVzQJmr](https://app.daily.dev/posts/lsRVzQJmr)

[Dash Santosh](https://hashnode.com/@santdas36)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036446505efef7f0a9d342f)

Well done!

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036446505efef7f0a9d342f#reply-6036594305efef7f0a9d36c6)

Thanks !

[Soumyadeep Paul](https://hashnode.com/@DigiTechPaul)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60361bf9bc9bf67747fddb66)

Amazing and very helpful for understanding the basics🔥🔥🔥

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60361bf9bc9bf67747fddb66#reply-60361e32bc9bf67747fddbbb)

Thank You for that !

[sudhanshu marimganti](https://hashnode.com/@sudhanshu937)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036161cbc9bf67747fdda3c)

Hi great article! Whats "lang" in your immutation example?

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036161cbc9bf67747fdda3c#reply-60361e010dde8f7722d1f752)

We are iterating over our "code" array using map function. We have passed "lang" in the map function. Which in simplest words means that "lang" is items in the array.

So basically "lang" = "Javascript" , "Python" & "React" respectively as respective times.

let me know, if you need more clarification

[sudhanshu marimganti](https://hashnode.com/@sudhanshu937)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036161cbc9bf67747fdda3c#reply-60361eb80dde8f7722d1f75e)

[Sayuri Kamble](https://hashnode.com/@sayuk) okay..actually it was "item" instead of lang..ok thanks for the reply!

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6036161cbc9bf67747fdda3c#reply-60368f420c99f77f2f8a5f86)

[sudhanshu marimganti](https://hashnode.com/@sudhanshu937) Yes your observation was correct

[Tanishq Singh Anand](https://hashnode.com/@TanishqSinghAnand)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6035f7b70dde8f7722d1f0ed)

OP man really helped a lot

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6035f7b70dde8f7722d1f0ed#reply-6036105f0dde8f7722d1f4e2)

Glad It Helped !

[Rahul](https://hashnode.com/@RAHULISM)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6035d4de0dde8f7722d1ed68)

Cooool Article.

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/6035d4de0dde8f7722d1ed68#reply-6035ea56bc9bf67747fdd35f)

Thank You !

[Bello](https://hashnode.com/@techstack)

[Feb 23, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60358521bc9bf67747fdce7a)

You rocked this article. Keep it up! 👍

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 24, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/60358521bc9bf67747fdce7a#reply-6035ea3abc9bf67747fdd358)

Means a lot. Thanks!

[Soham Parab](https://hashnode.com/@soham-parab)

[Feb 23, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603564f00dde8f7722d1e904)

Awesome work! Keep it uppppp!

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 23, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603564f00dde8f7722d1e904#reply-603569280dde8f7722d1e93e)

Thank You So Much !

[Suman Ghosh](https://hashnode.com/@retiredbatman)

[Feb 23, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603564b10dde8f7722d1e8f4)

Great Job Sayuri. Keep writing !

[Sayuri Kamble](https://hashnode.com/@sayurikamble)

[Feb 23, 2021](https://hashnode.com/posts/introduction-to-functional-programming/603563b4bc9bf67747fdcc75/comment/603564b10dde8f7722d1e8f4#reply-60356943bc9bf67747fdcd0e)

Thank You! Means a lot
