Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A series of pure real examples how of Functional Programming could give us a better approach than Object Oriented Programmig

NotificationsYou must be signed in to change notification settings

juliomatcom/object-vs-functional-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

We will learn through real examples howFunctional Programming can provide a better approach thanObject Oriented Programming- in some situations that we are currently dealing with.

JavaScript and FP

In JavaScript we can choose to use either of the OOP or FP paradigms as much, or as little, as we like. So, what is Functional Programming in a nutshell?

  • Immutable Data

Immutable datacannot be changed once created, leading to much simpler development and easier reasoning of appstate.

  • Pure functions

A pure function is a function that, given thesame input, will always return thesame output, does not have any observable side effects and does not rely on any external state.

All this is possible because in JavaScript functions arefirst-class citizens. This meansfunctions are objects (of the typeObject), and, therefore, can be assigned as thevalue of a variable. The ability to use higher-order functions -a function that takes a function as an argument or that returns a function as a result- makes JavaScript a suitable language for functional programming.

Now Let the fight begin:

About

A series of pure real examples how of Functional Programming could give us a better approach than Object Oriented Programmig

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp