基本データ型

基本データ型一覧

型名 説明 使用例
string 文字列型 const title = "Hello";
number 数値型(整数・小数) const price = 1200;
boolean 真偽値型 const isActive = true;
null 値が存在しないことを示す const value = null;
undefined 未定義の値(初期化されていない) const notSet = undefined;
symbol 一意な識別子 const key = Symbol("id");
bigint 大きな整数(2⁵³以上) const big = 1234567890123456789012345n;

🔍 nullundefinedstrictNullChecks オプションによって挙動が変わるため注意。

コメントを残す 0

Your email address will not be published. Required fields are marked *