Added comment to JS

Comment contains notes on basic function structure