What Is the Difference Between exports and module.exports?
exports and module.exports start as one object, but require() returns only module.exports. Learn why reassigning exports fails and what to use.
466 posts about JavaScript: questions with answers, tutorials and articles, newest first.
exports and module.exports start as one object, but require() returns only module.exports. Learn why reassigning exports fails and what to use.
Strict mode makes JavaScript throw errors for mistakes it normally ignores. See how to enable it, what it changes and when modules already use it.
Create a React function component with a capitalised function that returns JSX, then use it like an HTML tag and give it props.
require() loads a module and returns its module.exports. See how to export functions and objects, how paths resolve and why modules are cached.
Semicolons are optional thanks to ASI, but a few cases break silently. Learn the traps and how to enforce one style.
Use curly braces to put variables, function calls, conditions and lists inside JSX, and learn which values React renders or rejects.
A module is a file with its own private scope and explicit exports. Learn the kinds of Node.js modules, CommonJS versus ES modules and why modules matter.
The syntax rules every JavaScript program follows, plus the naming conventions and tools that keep code consistent.
The core JSX rules explained with fixes for the errors beginners hit: single root, closed tags, className, curly braces and component names.
Node.js can load a .env file with the --env-file flag, no dotenv package needed. See the file format, precedence rules and how it compares with dotenv.
How V8 turns JavaScript into bytecode and machine code, why consistent types help, and what the engine does not provide.
JSX is JavaScript syntax that looks like HTML. See how it compiles to function calls, what a React element is, and how it differs from HTML.
Read configuration from process.env, set variables on each operating system, convert strings to numbers and booleans and fail fast when a value is missing.
ECMAScript is the standard behind JavaScript. Learn the editions, the ES6 naming, TC39 stages, and how engines implement it.
React describes your UI with components and hooks, while ReactDOM turns that description into real browser DOM. Learn what each package exports.
Use process.argv.slice(2) for simple arguments and util.parseArgs for flags, defaults and validation, without installing any package.
Single-line, multi-line and JSDoc comments in JavaScript, plus special comments and habits that keep code readable.
Set up ESLint 9 flat config and Prettier in a React project, keep them from conflicting, and add scripts for your editor and CI.
The global process object describes your running Node.js program: arguments, environment, streams, exit codes, signals and memory. This guide tours its main features.
Print values with console.log in the browser and Node.js, format output, and use table, warn, error and group methods for debugging.