updated code comments
added missing JSDoc params
removed extra comma
added JSDoc param
simplified ternary operators