How to return void in JsDoc?

Closure Compiler

According to the documentation of Google’s Closure Compiler if nothing is being returned, the @return annotation should be omitted.

If there is no return value, do not use a @return tag.

Source: https://developers.google.com/closure/compiler/docs/js-for-compiler#tags

jsdoc-toolkit

However further documentation also states that the returnType and returnDescription are optional parameters.

returnType – Optional: the type of the return value.

returnDescription – Optional: any additional description.

Source: https://code.google.com/p/jsdoc-toolkit/wiki/TagReturns

Summary

You could either leave out the return annotation or include it without any parameters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)