I usually use something like the code below in my projects.
function example() {
/**
* Need to explain the purpose of X here.
* @type {number}
*/
var X = 100;
...
/**
* Need to explain the purpose of Y here.
* @type {string}
*/
var Y = 'abc';
...
return Z;
}