How do you get string length and access characters?
Read a JavaScript string length with the length property and access characters with brackets, at() and charAt(), including emoji and Unicode pitfalls.
466 posts about JavaScript: questions with answers, tutorials and articles, newest first.
Read a JavaScript string length with the length property and access characters with brackets, at() and charAt(), including emoji and Unicode pitfalls.
State is the data a component remembers between renders. Learn why plain variables are not enough and how state differs from props.
Write, overwrite and append to files in Node.js with writeFile and appendFile, choose the right flags and save JSON or large data safely.
The DOM is the browser's live tree of your page. Learn to select elements and change text, classes and structure with JavaScript without security mistakes.
Create JavaScript strings with single quotes, double quotes or template literals, and escape quotes, newlines and Unicode characters with a backslash.
Derive the visible list from search and sort state with filter() and a sorted copy, then render it with map() and stable keys.
Read text, JSON and large files in Node.js using readFile, readFileSync, fs promises and streams, and handle errors like ENOENT correctly.
Understand how JavaScript functions are declared and called, and how scope, closures and let, const and var decide which variables your code can see.
A step by step FizzBuzz JavaScript solution with the modulo operator, the check order pitfall, cleaner variants and how to explain it in an interview.
The React key prop lets React match list items between renders. Learn what goes wrong with index keys and how to choose stable, unique keys.
Use the Node.js path module to build, split and normalise file paths across operating systems, with join, resolve, parse and a safe traversal check.
A beginner guide to declaring variables with let and const, the JavaScript data types, and the arithmetic, comparison and logical operators.
See how break ends a JavaScript loop and continue skips an iteration, including labeled statements, switch use and why forEach does not support them.
Call map() on an array and return keyed JSX to render a list in React. See component rows, filtering, empty states and common errors.
Set up an npm workspaces monorepo with one install and lockfile, link local packages, run scripts across them and know when to add a task runner.
JavaScript is the language that makes web pages interactive. Learn what it is, how it relates to HTML and CSS, and what it can do in the browser.
Understand the JavaScript while and do...while loops, how the condition is checked, how to avoid infinite loops, and when while beats a for loop.
Use the ternary for two outcomes and && to show or hide one element in JSX. Includes the stray 0 trap and tips for avoiding nested ternaries.
Prepare package.json, preview the tarball with npm pack, publish with npm publish, manage versions and tags, and release safely from CI with provenance.
A walkthrough of the JavaScript for loop: its three parts, array iteration, counting down, nested loops, let versus var and when to use for...of.