Functions are small pieces of reusable and modular code that solve a specific problem or perform a specific set of actions. They are used to make code readable and eliminates redundant logic.
Functional programming is a concept in computer science that decomposes a problem into simpler problems in such a way that you can by reading a specific block of code - a pure function, know what that code block is solving.
And as such, you are only concerned with inputs and the outputs that it returns. It doesn't have a way to directly affect the output produced for a given input. A function also has no way to affect the state of its input. It also doesn't depend on a variable outside of its scope that can cause a side-effect. These are the properties of a pure function. Examples are map, reduce and filter.
An example
first = [1,2,3,4]