- Code: Select all
// Replicate a string 'n' number of times
String.prototype.replicate = function( n )
{
return new Array( isNaN( n ) ? 1 : n++ ).join( this )
}
All prototypes generate a similar warning:
The property replicate is undefined for the javascript type String.
What is the proper way to annotate this using JSDocs to get rid of the warnings?