本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

JavaScript ドキュメント
JavaScript
Getting StartedSyntax BasicsTypes and DataModules and PackagesErrors and TestingKey Concepts: Async and Closures
ディスカッション

JavaScript ガイド · 3/6

Types and Data

この章は現在、英語でのみ提供しています。

JavaScript is dynamically typed: values have types, variables do not. This chapter tours the primitive types, objects, arrays and their methods, Map and Set, classes and prototypes, and JSON.

Primitives

There are seven primitive types. Primitives are immutable and compared by value.

TypeExampletypeof
string"hi""string"
number42, 3.14, NaN"number"
bigint9007199254740993n"bigint"
booleantrue"boolean"
undefinedundefined"undefined"
nullnull"object" (a historical bug)
symbolSymbol("id")"symbol"
console.log(0.1 + 0.2);         // 0.30000000000000004, floating-point rounding
console.log(Number("42px"));    // NaN
console.log(Number.isNaN(NaN)); // true
console.log(2 ** 53 + 1);       // 9007199254740992, precision runs out
console.log(2n ** 53n + 1n);    // 9007199254740993n, bigint stays exact

Every number is a 64-bit float, so do money math in whole units such as cents. The falsy values are false, 0, -0, 0n, "", null, undefined and NaN; everything else, including [] and {}, is truthy.

Objects

An object is a bag of key/value pairs. Use dot or bracket access, and use shorthand when a variable already has the key's name. Objects are passed by reference, so assigning one to another variable does not copy it.

const name = "Jordan";
const user = {
  name, // shorthand for name: name
  age: 29,
  "favorite-color": "blue",
  introduce() {
    return `I'm ${this.name}.`;
  },
};

console.log(user["favorite-color"]); // "blue"
console.log(user.introduce());       // "I'm Jordan."

for (const [key, value] of Object.entries(user)) {
  console.log(key, typeof value);
}

const alias = user;
alias.age = 30;
console.log(user.age); // 30, same object

Arrays and array methods

Array methods say what you mean more clearly than hand-written loops. map, and return something new and leave the original alone; , , and mutate in place.

この章について質問がありますか?
前の章Syntax Basics次の章Modules and Packages
filter
reduce
push
sort
reverse
splice
const products = [
  { name: "mouse", price: 25, stock: 3 },
  { name: "monitor", price: 320, stock: 0 },
  { name: "keyboard", price: 89, stock: 7 },
];

const names = products.map((p) => p.name);
const inStock = products.filter((p) => p.stock > 0);
const total = products.reduce((sum, p) => sum + p.price, 0); // 434
const monitor = products.find((p) => p.name === "monitor");
const anySoldOut = products.some((p) => p.stock === 0);   // true
const allCheap = products.every((p) => p.price < 100);    // false

// sort mutates, so copy first
const byPrice = [...products].sort((a, b) => a.price - b.price);

Without a compare function, sort() compares elements as strings, so [10, 9, 1].sort() gives [1, 10, 9]. Always pass (a, b) => a - b for numbers.

Map and Set

Map is a key/value store that accepts any value as a key; Set holds unique values. Prefer Map over a plain object when keys are added and removed often or are not strings.

const visits = new Map();
visits.set("/home", 10);
visits.set("/home", visits.get("/home") + 1);
console.log(visits.get("/home"), visits.size); // 11 1

const tags = new Set(["js", "web", "js"]);
console.log(tags.size, tags.has("web")); // 2 true

const unique = [...new Set([3, 1, 3, 2, 1])]; // [3, 1, 2]

Classes and prototypes

Every object inherits from another object, its prototype. The class syntax is a readable layer over this prototype-based inheritance. Fields starting with # are private and invisible outside the class.

class Account {
  #balance = 0;

  constructor(owner) {
    this.owner = owner;
  }

  deposit(amount) {
    if (amount <= 0) throw new RangeError("Amount must be positive");
    this.#balance += amount;
    return this;
  }

  get balance() {
    return this.#balance;
  }
}

class SavingsAccount extends Account {
  constructor(owner, rate) {
    super(owner);
    this.rate = rate;
  }
}

const acc = new SavingsAccount("Lee", 0.03).deposit(1000);
console.log(acc.balance);                // 1000
console.log(acc instanceof Account);     // true
console.log(Object.getPrototypeOf(acc) === SavingsAccount.prototype); // true

Methods live once on the prototype rather than on each instance. When a property is missing on an object, lookup climbs the prototype chain until it finds it or runs out.

JSON

JSON is the lingua franca for exchanging data. JSON.stringify turns a value into text and JSON.parse turns text back into a value.

const data = { id: 1, createdAt: new Date(0), secret: undefined };

const text = JSON.stringify(data, null, 2); // pretty-print with 2 spaces
const parsed = JSON.parse(text);
console.log(typeof parsed.createdAt); // "string": dates do not survive
console.log("secret" in parsed);      // false: undefined is dropped

const copy = structuredClone(data); // deep copy that keeps the Date

JSON cannot hold functions, undefined or symbols, and dates become strings. Malformed input makes JSON.parse throw a SyntaxError, so wrap untrusted data in try...catch.

Summary

  • Seven primitives are handled by value; objects are handled by reference.
  • Learn map, filter, reduce and find, and remember that sort mutates.
  • Use Map for dynamic keys and Set for de-duplication.
  • class wraps prototype inheritance and supports #private fields.
  • Know what JSON does to dates and undefined before relying on it.

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。