JSDoc bụ ihe na-emepụta akwụkwọ dị ike maka JavaScript. Ọ na-eji nkọwa ahaziri ahazi iji mepụta akwụkwọ API zuru ezu maka koodu gị. Site na ịgbakwunye nkọwa JSDoc na faịlụ Javascript gị, ị nwere ike ịnye ozi doro anya na ahaziri maka ọrụ gị, klaasị na modul gị.
Isi atụmatụ nke JSDoc:
Ụdị ozi
Paragraf ọrụ yana ụkpụrụ nloghachi
Klas na nkọwa usoro
Akwụkwọ modul
Otu mkpado bara uru na JSDoc bụ mkpado @ihe atụ. Mkpado a na-enye gị ohere itinye ihe atụ koodu na akwụkwọ gị. Ihe na-ekewa ngwá ọrụ anyị iche bụ ike ya idowe nhazi, ntinye, na nkwụsị ahịrị n'ime @example mkpado. Nke a pụtara na ị nwere ike dee ihe atụ koodu ndị a na-agụ agụ, na-eme ka ọ dịrị ndị mmepe mfe ịghọta otu esi eji ọrụ ma ọ bụ klaasị gị.
Ojiji ọmụmaatụ:
/**
* Calculates the sum of two numbers.
* @param {number} a - The first number.
* @param {number} b - The second number.
* @returns {number} The sum of a and b.
* @example
* // This example preserves formatting and line breaks
* const result = add(5, 3);
* console.log(result);
* // Output: 8
*/
function add(a, b) {
return a + b;
}
Site n'iji onye na-emepụta okwu JSDoc dị n'ịntanetị, ị nwere ike ịmepụta akwụkwọ ahazi nke ọma nke na-agụnye nhazi nke echekwara na ihe atụ koodu gị, na-eme ka akwụkwọ Javascript gị doo anya ma dị irè.