javascript Array and String Prototype Functions: slugify, sum and newSlice