Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. JavaScript Dictionary

JavaScript Dictionary

[Beginner's Guide] JavaScript OverviewAn overview of JavaScript and a guide to the recommended learning order for each feature.
[Setup] JavaScript Development EnvironmentStep-by-step guide to setting up an environment for running JavaScript.
Creating and Running .js FilesHow to write .js files and run them with Node.js or in a browser.
document.querySelector()Gets the first HTML element matching the given CSS selector.
document.querySelectorAll()Gets all HTML elements matching the given CSS selector.
document.getElementById()Gets the HTML element with the specified ID.
HTML Element .textContentGets or sets the text content of an HTML element without interpreting HTML tags.
HTML Element .innerHTMLGets or sets the inner HTML of an element as a string.
HTML Element .classListAdds, removes, toggles, or checks for classes on an HTML element.
HTML Element .getAttribute()Gets the value of the specified attribute of an HTML element.
HTML Element .setAttribute()Sets the specified attribute on an HTML element.
document.createElement()Creates a new HTML element with the specified tag name.
Parent Element .appendChild()Appends an HTML element as the last child of a parent element.
HTML Element .addEventListener()Registers an event listener on an HTML element.
HTML Element .remove() / removeChild()Removes an HTML element; remove() removes itself, removeChild() removes a child element.
Parent Element .replaceChild() / insertBefore()Replaces or inserts a child element; replaceChild() replaces and insertBefore() inserts at a specific position.
HTML Element .cloneNode()Clones an HTML element; the argument specifies whether to include child elements.
HTML Element .closest() / matches()Searches or tests HTML elements by selector; closest() searches ancestors, matches() checks if the element itself matches.
HTML Element .styleManipulates inline styles; gets, sets, or removes CSS properties.
HTML Element .datasetReads and writes data attributes; accesses data-* attributes using camelCase.
HTML Element .innerTextGets or sets the displayed text content, with a comparison to textContent.
document.createTextNode() / createDocumentFragment()Creates a text node or document fragment, also useful for XSS prevention.
HTML Element .parentNode / parentElementGets the parent element, with a comparison between parentNode and parentElement.
HTML Element .children / firstElementChild / lastElementChildGets child elements; children returns all children, first/last returns the first or last.
HTML Element .nextElementSibling / previousElementSiblingGets sibling elements; retrieves the next or previous HTML element.
HTML Element .removeEventListener()Removes an event listener; note that anonymous functions cannot be removed.
event.target / currentTargetGets the event source element; target is the actual element, currentTarget is where the listener is registered.
event.preventDefault() / stopPropagation()Cancels or stops event propagation; suppresses default behavior and controls bubbling.
HTML Element .dispatchEvent()Fires a custom event; CustomEvent allows attaching data to the event.
Array .push() / pop() / shift() / unshift()Adds or removes elements at the end or beginning of an array.
Array .splice()Adds, removes, or replaces elements at any position in an array.
Array .forEach() / map()Iterates over an array or transforms it; forEach() has no return value, map() returns a new array.
Array .find() / findIndex() / findLast() / findLastIndex()Search for the first element that matches a condition.
Array .filter()Extracts all elements matching a condition into a new array.
Array .reduce()Reduces an array to a single value; useful for sums, maximums, and object conversions.
Array .includes() / indexOf() / lastIndexOf()Checks for a value in an array or finds its position; includes() returns true/false, indexOf() returns the position.
Array .some() / every()Tests conditions across an array; some() is true if any match, every() is true if all match.
Array .slice() / concat()Extracts a portion of an array or concatenates arrays without modifying the original.
Array .sort() / reverse()Sorts or reverses an array; a comparison function controls the order of numbers or strings.
Array .flat() / flatMap()Flattens a nested array; flat() expands it, flatMap() performs map and flat simultaneously.
Array .join() / String .split()Converts between arrays and strings; join() joins, split() splits.
Array.from() / Array.isArray()Creates or checks arrays; Array.from() converts array-like objects into arrays.
String .indexOf() / lastIndexOf() / includes()Searches within a string or checks for existence; indexOf() returns the position, includes() returns true/false.
String .startsWith() / endsWith()Checks the beginning or end of a string; determines whether it starts or ends with a given string.
String .slice() / substring()Extracts a portion of a string by specifying start and end positions.
String .charAt() / at()Gets the character at a specified position; at() also supports negative indexes.
String .replace() / replaceAll()Replaces text in a string; replace() replaces the first occurrence, replaceAll() replaces all.
String .toUpperCase() / toLowerCase()Converts text to uppercase or lowercase; also useful for case-insensitive comparisons.
String .trim() / trimStart() / trimEnd()Removes whitespace; deletes whitespace from the start, end, or both sides of a string.
String .padStart() / padEnd() / repeat()Pads or repeats a string; useful for zero-padding or generating fixed-length strings.
Object.keys() / values() / entries()Gets a list of object keys or values as an array for loop processing.
Object.assign()Copies or merges objects; also covers comparison with spread syntax.
Object.freeze() / seal()Prevents changes to an object; freeze() fully freezes it, seal() only prevents adding or deleting properties.
parseInt() / parseFloat() / Number()Converts a string to a number; parseInt() converts to an integer, parseFloat() to a decimal.
Number.isNaN() / isFinite() / isInteger()Checks whether a value is a number, NaN, a finite number, or an integer safely.
Number .toFixed() / toPrecision()Formats a number as a string with a specified number of decimal places or significant digits.
Math.floor() / ceil() / round() / trunc()Rounds a number; floor rounds down, ceil rounds up, round rounds to nearest, trunc removes decimals.
Math.max() / min() / abs() / random()Compares numbers, generates random numbers, or gets absolute values; also covers use with arrays.
new Date() / Date.now()Creates a date-time object; gets the current time, a specific date, or a timestamp.
Date .getFullYear() / getMonth() / getDate()Gets individual date-time components such as year, month, day, and day of the week.
Date .toLocaleDateString() / toISOString()Converts date-time to a string; supports locale-aware display and ISO format conversion.
JSON.parse() / stringify()Converts JSON; converts between strings and objects bidirectionally.
new Promise() / then() / catch() / finally()Basic Promise operations; handles success and failure of asynchronous processing.
Promise.all() / allSettled() / race() / any()Controls multiple Promises; waits for all to complete, all results, the fastest, or the first success.
async / awaitA concise syntax for asynchronous processing; writes Promises more intuitively.
setTimeout() / clearTimeout()Executes a process after a specified delay; can be cancelled with clearTimeout().
setInterval() / clearInterval()Repeats a process at a specified interval; can be stopped with clearInterval().
fetch()Sends HTTP requests using a Promise-based communication API.
XMLHttpRequestA traditional HTTP request method for environments where fetch() is unavailable.
localStorage / sessionStorageSaves data in the browser; localStorage persists permanently, sessionStorage persists per tab.
console.log() / error() / warn() / table()Outputs to the console; essential methods for debugging.
window.location / historyControls page navigation and history; retrieves URLs and handles page transitions.
RegExp .test() / exec()Pattern matching with regular expressions; test() returns true/false, exec() returns detailed results.
String .match() / matchAll() / search()Searches strings with regular expressions; match() finds matches, search() returns the position.
MapA collection that manages key-value pairs; any type can be used as a key.
SetA collection that manages unique values; duplicate values are automatically removed.
try / catch / finally / throwThe basic syntax for error handling; controls error catching, processing, and cleanup.
Arrow Function (=>)A concise function expression syntax introduced in ES2015; it lexically binds this, making it widely used in callbacks.
class SyntaxA class definition syntax introduced in ES2015; groups constructors, methods, and inheritance in one place.
Comment (// / /* */)Single-line (//) and block (/* */) comment syntax; used to explain code intent or temporarily disable code.
Destructuring AssignmentSyntax introduced in ES2015 for unpacking array and object values into variables; supports defaults, aliases, and nesting.
for StatementA loop syntax that writes initialization, condition, and update in one line, suited for counter-based iteration.
for...in / for...offor...in enumerates object property names; for...of iterates over values from iterables such as arrays.
Function Declaration / Function ExpressionTwo ways to define functions using the function keyword: declarations and expressions, which differ in hoisting behavior.
if / else if / elseThe fundamental conditional branching syntax that switches which block to execute based on whether a condition is true or false.
import / export (ES Modules)ES Modules syntax for sharing code between files; export declares public items, import brings them in.
Operators (Arithmetic / Comparison / Logical)The three basic operator categories: arithmetic, comparison, and logical; used for calculations, conditions, and boolean logic.
return StatementSyntax for returning a value from a function to the caller; also covers early return guard clauses and returning multiple values.
Spread Syntax (...)Syntax introduced in ES2015 for expanding array and object elements; used for copying, merging, and spreading as arguments.
switch StatementA multi-way branching syntax that matches an expression against multiple case labels and executes the matching block.
Template Literal (`${}`)A syntax that embeds variables and expressions directly in backtick-quoted strings; also supports multi-line strings.
Ternary Operator (condition ? true : false)A shorthand conditional expression that returns one of two values on a single line based on a condition.
this KeywordA keyword that refers to the current context object; its value changes across five different calling contexts.
typeof / instanceoftypeof returns the type of a value as a string; instanceof checks whether an object is an instance of a specific class.
var / let / constThree variable declaration keywords; they differ in scope, hoisting, and reassignability. const is the modern default.
while / do-whilewhile evaluates the condition before each iteration; do-while always runs the block once before evaluating the condition.