This is part || of Data Structures & Algorithms using Javascript. I would like to give credit to freeCodeCamp.org for their series of videos covering this topic.
In part I we started off with a simply defining a few data types – an array and a string for storing data in memory. Then we used a “for-loop” to access and manipulate our data structures. Finally we came up with a sequence of steps to test whether a word was a palindrome or not. In part II now, were going to wrap up all that code into what we call a function object.
Functions are a powerful data structure encapsulating your algorithms. Functions also are a good example of “DRY” – Don’t Repeat Yourself.