JSDoc
ELI5 — The Vibe Check
JSDoc is like writing sticky notes for your JavaScript code that IDEs can actually read. You add special comments above your functions, and suddenly VS Code knows all your types without needing TypeScript. It's type safety for the commitment-phobic.
Real Talk
A documentation standard for JavaScript that uses specially formatted comments (/** */) to describe types, parameters, return values, and other metadata. JSDoc enables TypeScript-level type checking in plain JavaScript files, powers IDE autocompletion, and can generate API documentation automatically.
Show Me The Code
/**
* Calculates the area of a rectangle
* @param {number} width - The width
* @param {number} height - The height
* @returns {number} The area
*/
function area(width, height) {
return width * height;
}
When You'll Hear This
"We use JSDoc instead of TypeScript because the team doesn't want a build step." / "Add JSDoc to your functions — your IDE will love you for it."
Related Terms
Documentation
Documentation is written explanation of how your code works and why.
JavaScript
JavaScript is what makes websites actually DO stuff. HTML is the bones, CSS is the skin, and JavaScript is the muscles and brain.
Type Inference
Type inference is the compiler being smart enough to figure out what type something is without you having to spell it out.
TypeScript
TypeScript is JavaScript with a strict parent watching over it.