/Javascript-class-methods-in-functional

Javascript OOP and Functional programming tutorial

Primary LanguageJavaScript

Javascript-class-methods-in-functional

  • This project was created by pure javascript and in the project from ES6 class methods in functional with modular structure

  • Examples from OOP & Functional ( FP ) :

Step 1 : 


* Creating a class

* Using constructor method

Class Structure in Javascript

FP Structure in Javascript

Step 2 : 


* Creating another class

* Using inheritance in OOP & FP

Class Structure in Javascript (1)

FP Structure in Javascript (1)

Step 3 : 


* Adding new method for every class

* Calling the method for using that

Class Structure in Javascript (2)

FP Structure in Javascript (2)

Step 4 : 


* Using static method in OOP & FP

* Creating a simple project with OOP & FP for comparing between both

Class Structure in Javascript (3)

FP Structure in Javascript (3)

  • Finally, if you wanna work with these files, you should open index.html file and you'll see the result in console of browser like this picture

Demo

  • I hope you'll like it and tnx for watching 🙏❤️

new Update

Step 5 : 


* Using Getter and Setter methods in OOP & FP

* doing a example for updating a name with those methods

Class Structure in Javascript

FP Structure in Javascript