Add better function documentation in JavaScript