Class 9
Back to home page
## Functional programming concepts
Q. What is functional programming?
- Functional programming is a style of programming or building the structure of a web page, where the user avoids changing state and mutable data.
Q. What is a pure function and how do we know if something is a pure function?
- A pure function is a function that will always return back the same result given the argument.
Q. What are the benefits of a pure function?
- They dont cause any observable side effects.
Q. What is immutability?
- Immutability is when a state cannot be changed once its created.
Q. What is Referential transparency?
- A referential function is what happens when you combine both a pure and immutable data together. This means it will consistantly return the same result, based on the same input value.
Node js for beginners
Q. What is a module?
- A module is logical piece of code that has a certain functionality, pretty much seperate JS files with functions.
Q. What does the word ‘require’ do?
- Require is a path we can use to call apon seperate JS files. Similar to import.
Q. How do we bring another module into the file the we are working in?
- You specify what functions you want to require by using module.export = whateverFunctionYouwanttoExport.
Q. What do we have to do to make a module available?
- Export the specific function you want, and use require to access or call apon that function.
Things I want to know more about
How specific or vague can you be when exporting a function? can you export a specific part of a function or the whole function?