Documenting JavaScript

Documenting JavaScript

Documenting JavaScript. JSDoc is the JavaScript implementation of DocBlock, a documentation approach used in various programming languages, including PHP, Ruby, and Python. JSDoc is a popular approach to inline documentation used in many code bases.

JSDoc is a popular approach to inline documentation used in many code bases.

At its simplest, it involves creating a comment with two leading asterisks (/**), and a description of what the function does.

/**
 * Add two numbers together
 */
function add (num1, num2) {
    return num1 + num2;
}

The JSDoc becomes more meaningful when you add tags: additional details about the function, it’s parameters, and what it returns.

You can find a full list on the JSDoc website, but the most common are @param, which describes a function parameter, and @return, which describes what’s returned.

/**
 * Add two numbers together
 * @param  {Number} num1 The first number to add
 * @param  {Number} num2 The second number to add
 * @return {Number}      The total
 */
function add (num1, num2) {
    return num1 + num2;
}

Why use JSDoc?

JSDoc is the JavaScript implementation of DocBlock, a documentation approach used in various programming languages, including PHP, Ruby, and Python.

It provides a consistent and recognizable approach to documentation. There are also several tools that can automatically generate documentation from JSDoc comments.

javascript web-development programming developer

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Hire Dedicated JavaScript Developers -Hire JavaScript Developers

Hire dedicated JavaScript Developers who are proficient in AngularJS, ReactJS, NodeJS, & VueJS frameworks. Get flexible hiring models as per your business requirements.

JavaScript Web Developer Bootcamp - Complete Guide to Become JavaScript Developer

In this Video we will learn these concept and there are almost 10+ Project in javaScript. One Video For becoming web developer. This video will teach you web development from scratch.

Why Web Development is Important for your Business

With the rapid development in technology, the old ways to do business have changed completely. A lot more advanced and developed ways are ...

Important Reasons to Hire a Professional Web Development Company

    You name the business and I will tell you how web development can help you promote your business. If it is a startup or you seeking some...

Web App Development Company | Web Application Development Service

Web development company in India & USA offers different types of web application development services with the best result oriented, clients all specifications, different technologies, etc with a cost-effective rate. Get a free quote.