Just watched a video(1) about functional programming and this is the gist of it (for those like me who don't know).
Three main things of functional programming:
1. Keep your data and function independent
2. avoid changing state of variables, instead declare others
3. accept function/reference as a param