Utilizing various sources, trying to implement my own functional library in JS