本文へスキップ
製品デスクトップツール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 ガイド · 2/6

Syntax Basics

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

This chapter covers the syntax you will read and write every day: declaring variables, writing functions, branching and looping, template literals, and the destructuring and spread syntax that shows up all over modern JavaScript.

let, const and var

There are three ways to declare a variable. Reach for const by default and switch to let only when the variable must be reassigned. var still appears in older code, but there is rarely a reason to write it today.

KeywordReassignableScopeNotes
constNoBlockThe default choice
letYesBlockFor values that change
varYesFunctionHoisting makes it confusing
const greeting = "Hello";
let count = 0;
count += 1;

if (true) {
  let inside = "block";
  var leaked = "function";
}
console.log(leaked); // "function": var escapes the block
// console.log(inside); // ReferenceError: let stays inside it

const user = { name: "Sam" };
user.name = "Alex"; // allowed: const blocks reassignment, not mutation

const does not freeze an object. If you need the contents locked too, use Object.freeze().

Functions and arrow functions

A function declaration can be called from anywhere in its scope. Arrow functions are shorter and shine as callbacks. Both support default values and rest parameters.

function add(a, b) {
  return a + b;
}

// a single-expression body needs no braces or return
const square = (x) => x * x;
const makeUser = (name) => ({ name, createdAt: Date.now() }); // wrap object literals in parentheses

function greet(name = "guest", ...tags) {
  return `${name} (${tags.join(", ")})`;
}

console.log(add(2, 3));                 // 5
console.log(square(4));                 // 16
console.log(greet());                   // "guest ()"
console.log(greet("Kim", "vip", "new")); // "Kim (vip, new)"

Arrow functions also differ in how they treat this; chapter 6 explains why that matters.

Control flow

Compare with === and !==. The loose == converts types first, which is how 0 == "" ends up true.

const fruits = ["apple", "pear", "grape"];

for (const fruit of fruits) {
  console.log(fruit);
}

for (let i = 0; i < fruits.length; i += 1) {
  if (fruits[i] === "pear") continue;
  console.log(i, fruits[i]);
}

const score = 82;
const grade = score >= 90 ? "A" : score >= 80 ? "B" : "C";

switch (grade) {
  case "A":
    console.log("Excellent");
    break;
  case "B":
    console.log("Good");
    break;
  default:
    console.log("Keep going");
}

// optional chaining and nullish coalescing
const config = { server: { port: 0 } };
const port = config.server?.port ?? 3000; // 0, because ?? only replaces null/undefined
const host = config.server?.host ?? "localhost";
この章について質問がありますか?
前の章Getting Started次の章Types and Data

for...of walks the values of an array; for...in walks the keys of an object, so prefer for...of for arrays. When supplying defaults, ?? keeps legitimate values like 0 or "" that || would throw away.

Template literals

Backtick strings accept embedded expressions with ${...} and can span several lines.

const item = "keyboard";
const price = 45;

const message = `The ${item} costs $${price.toFixed(2)}.
With shipping: $${(price + 5).toFixed(2)}`;

console.log(message);

Destructuring

Destructuring pulls values out of objects and arrays into variables. You can rename and supply defaults on the way, and it works directly in function parameters.

const order = { id: 17, customer: "Riley", items: ["pen", "notebook"], note: undefined };

const { id, customer: buyer, note = "no note" } = order;
console.log(id, buyer, note); // 17 "Riley" "no note"

const [first, second] = order.items;

// swap two variables
let a = 1;
let b = 2;
[a, b] = [b, a];

function printOrder({ id, items }) {
  console.log(`#${id}: ${items.length} items`);
}
printOrder(order);

Spread

Putting ... in front of an array or object expands its contents. It is the usual way to copy or merge without touching the original. Keep in mind the copy is shallow: nested objects are still shared.

const base = [1, 2, 3];
const more = [...base, 4, 5]; // [1, 2, 3, 4, 5]

const defaults = { theme: "light", lang: "en" };
const settings = { ...defaults, theme: "dark" }; // later keys win

console.log(Math.max(...base)); // 3
console.log(defaults.theme);    // "light", untouched

Summary

  • Default to const, use let for reassignment, and avoid var.
  • Mix declarations and arrow functions as fits; lean on default and rest parameters.
  • Compare with ===; reach for ?. and ?? when a value may be missing.
  • Template literals, destructuring and spread are everywhere in modern code, so practice them until they feel natural.

コメント 0件

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

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