How to JsDoc a "mixed" type?

Tower picture Tower · Feb 5, 2011 · Viewed 15.3k times · Source

Simple question, how do I document that "Mixed-type"? I know I could just list all possible types like {null|undefined|String|Number|Object} and end up finding myself missing one and making it overly complex. I tried using the Mixed keyword, but it popups errors in many IDEs such as WebStorm.

Answer

Tower picture Tower · Jul 21, 2011

I found the way to do it:

/**
 * @param {*} foo
 */
function bar(foo) {}