FUNCTIONAL PROGRAMMING


FUNCTIONAL PROGRAMMING

Functional Programming Concepts

fun

1. What is functional programming?

a style of building the structure and elements of computer programs, that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data

 

2. What is a pure function and how do we know if something is a pure function?

It returns the same result if given the same arguments, and It does not cause any observable side effects.

 

3. What are the benefits of a pure function?

You’ll always get the same result, as all the code a pure function uses is inside of it or gets past to it as parameters.

 

4. What is immutability?

When talking about data, it means the state of the data cannot be changed after it’s created.

 

5. What is Referential transparency?

if a function consistently yields the same result for the same input, it is referentially transparent.

 


Node JS Tutorial for Beginners #6 - Modules and require()

1. What is a module?

Modules are small-ish certain packages of code and js files that we can use to do specific things, we use them so we don’t have to download a metric ton of code everytime, and instead just get this comparatively small number of files.

 

2. What does the word ‘require’ do?

require imports and gets the module from the specified path, so you can not use the module in any file you want.

 

3. How do we bring another module into the file the we are working in?

by assigning a variable to whatever require gets from the the modules.

 

4. What do we have to do to make a module available?

you first have to export it, using module.export = function;

 


   

Get back to EMAM’S HOMEPAGE

I have created this page as a part of my project using Github, Please visit my profile, I will be more than happy to hear from you all.                       © Emam Shararah 2021