Answer the question
In order to leave comments, you need to log in
How can type be used as a number in JSDOC?
There is a banal function using JSDOC, and you can insert the argument test value1, value2 into it, others will be like errors. Is it possible to use a number instead of a string?
Here is an example with string that will work
/**
* @param {'value1', 'value2'} test
*/
function example(test){}
example('value1');
/**
* @param {1, 2} test
*/
function example(test){}
example(1);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question