Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does decorators in comments have any effect on code?

I have seen some code where the decorator are in comments, theses comments are highlighted - see my example coming from this code, so I'm wondering if there is any effect from theses lines of code. Here is an example:

/**
 * Instanciate a new Payment.
 * @param payplugApi Object  The PayplugAPI with sucessfull authentication
 * @param paymentTracker String  A payment tracker (id) that will be send and received by PayPlug API to follow the payment. This tracked will be inserted in metadata
 * @param payment   Object  The payment options. More informations here : https://www.payplug.com/docs/api/apiref.html?powershell#create-a-payment
 * @return [nothing]
 * @see PayPlugAPI.authenticate The authentication method
 */
var Payment = function () {...}

Is it just documentation or performing code?

Any hint would be great, thanks!

like image 317
Webwoman Avatar asked Feb 24 '26 13:02

Webwoman


1 Answers

These are JSDoc comments and are parsed for the purposes of generating documentation (and "hover"-hints etc in the IDE). They have no relationship to decorators.

like image 161
spender Avatar answered Feb 27 '26 04:02

spender