This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback

引数の小数部分が 0.5 以上の場合、その引数は、次に大きい整数に切り上げられます。引数の小数部分が 0.5 未満の場合、その引数は、次に小さい整数に切り下げられます。小数部分が 0.5 である場合は、正の無限大の方向で次の整数に丸められます。これは多くの言語の round() 関数と異なることに注意してください。この場合はたいてい、0 から遠ざかる次の整数に丸められます (小数部分が 0.5 である負の値を四捨五入する場合に、結果が変わります)。 Math.round(x) は、 Math.floor(x + 0.5) とまったく同じではありません。 x が -0、または -0.5 ≤ x < 0 の場合、 Math.round(x) は -0 を返し、一方、 Math.floor(x + 0.5) は 0 を返します。しかし、この違いや潜在的な精度エラーを無視すれば、 Math.rou
オブジェクトを凍結することは、拡張を禁止し、既存のすべてのプロパティの記述子の configurable を false に変更すること、そしてデータプロパティについては、 writable を同様に false に変更することと同じです。凍結したオブジェクトのプロパティ設定には、何も追加したり除去したりすることはできません。これを行おうとすると、静かに、あるいは TypeError 例外が発生し、失敗します(厳格モードの場合によく発生しますが、これに限ったことではありません)。 凍結されたオブジェクトのプロパティは、 writable 属性と configurable 属性が false に設定されているため、値を変更することはできません。アクセサプロパティ(ゲッターとセッター)も同じように動作します。ゲッターによって返されるプロパティ値は変更される可能性があり、セッターはプロパティを設
// 新しいオブジェクトは拡張可能であるので、凍結されていません Object.isFrozen({}); // false // 拡張可能ではない空のオブジェクトは、他に何もしなくても // 凍結されています const vacuouslyFrozen = Object.preventExtensions({}); Object.isFrozen(vacuouslyFrozen); // true // プロパティをひとつ持つ新しいオブジェクトも拡張可能であり、 // それゆえ凍結されていません const oneProp = { p: 42 }; Object.isFrozen(oneProp); // false // オブジェクトを拡張不可にしても、それは凍結されません // なぜなら、まだプロパティが設定変更可能 // (かつ書き込み可能) であるからです Object.prev
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016. Learn moreSee full compatibilityReport feedback アロー関数式は、従来の関数式の簡潔な代替構文ですが、意味的な違いや意図的な使用上の制限もあります。 アロー関数自身には this、arguments、super へのバインドがないので、メソッドとして使用することはできません。 アロー関数はコンストラクターとして使用することはできません。 new をつけて呼び出すと TypeError が発生します。 new.target キーワードにアクセスすることもできません。
標準組み込みオブジェクトStringコンストラクターString() コンストラクター静的メソッドString.fromCharCode()String.fromCodePoint()String.raw()インスタンスメソッドString.prototype.anchor() 非推奨; String.prototype.at()String.prototype.big() 非推奨; String.prototype.blink() 非推奨; String.prototype.bold() 非推奨; String.prototype.charAt()String.prototype.charCodeAt()String.prototype.codePointAt()String.prototype.concat()String.prototype.endsWith()String.prot
標準組み込みオブジェクトStringコンストラクターString() コンストラクター静的メソッドString.fromCharCode()String.fromCodePoint()String.raw()インスタンスメソッドString.prototype.anchor() 非推奨; String.prototype.at()String.prototype.big() 非推奨; String.prototype.blink() 非推奨; String.prototype.bold() 非推奨; String.prototype.charAt()String.prototype.charCodeAt()String.prototype.codePointAt()String.prototype.concat()String.prototype.endsWith()String.prot
const animals = ["pigs", "goats", "sheep"]; const count = animals.push("cows"); console.log(count); // Expected output: 4 console.log(animals); // Expected output: Array ["pigs", "goats", "sheep", "cows"] animals.push("chickens", "cats", "dogs"); console.log(animals); // Expected output: Array ["pigs", "goats", "sheep", "cows", "chickens", "cats", "dogs"]
標準組み込みオブジェクトArrayコンストラクターArray() コンストラクター静的メソッドArray.from()Array.fromAsync()Array.isArray()Array.of()静的プロパティArray[Symbol.species]インスタンスメソッドArray.prototype.at()Array.prototype.concat()Array.prototype.copyWithin()Array.prototype.entries()Array.prototype.every()Array.prototype.fill()Array.prototype.filter()Array.prototype.find()Array.prototype.findIndex()Array.prototype.findLast()Array.prototype.find
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback for...of 文は、反復可能オブジェクトをソースとした一連の値を処理するループを実行します。反復可能オブジェクトには、 たとえば組み込みの Array, String, TypedArray, Map, Set, NodeList(およびその他の DOM コレクション)、同様に arguments オブジェクトや、ジェネレーター関数から生成されるジェネレーター、ユーザー定義の反復可能オブジェクトなどがあります。
標準組み込みオブジェクトMapコンストラクターMap() コンストラクター静的メソッドMap.groupBy()静的プロパティMap[Symbol.species]インスタンスメソッドMap.prototype.clear()Map.prototype.delete()Map.prototype.entries()Map.prototype.forEach()Map.prototype.get()Map.prototype.has()Map.prototype.keys()Map.prototype.set()Map.prototype.values()Map.prototype[Symbol.iterator]()インスタンスプロパティMap.prototype.size継承Object/Function静的メソッドFunction.prototype.apply()Function.p
Math.floor(-Infinity); // -Infinity Math.floor(-45.95); // -46 Math.floor(-45.05); // -46 Math.floor(-0); // -0 Math.floor(0); // 0 Math.floor(4); // 4 Math.floor(45.05); // 45 Math.floor(45.95); // 45 Math.floor(Infinity); // Infinity この例では、 decimalAdjust() というメソッドを実装します。これは、Math.floor()、Math.ceil()、Math.round() の拡張メソッドです。 Math の 3 つの関数は常に数値を小数点以下の桁数に調整しますが、 decimalAdjust は exp 引数を受け入れ、数値を調整する小数点
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback bind() は Function インスタンスのメソッドで、新しい関数を生成し、呼び出し時に、 this キーワードを指定された値に設定し、指定された引数の並びを、新しい関数が呼び出された際に指定されたものより前にして呼び出します。 const module = { x: 42, getX: function () { return this.x; }, }; const unboundGetX = module.getX
標準組み込みオブジェクトObjectコンストラクターObject() コンストラクター静的メソッドObject.assign()Object.create()Object.defineProperties()Object.defineProperty()Object.entries()Object.freeze()Object.fromEntries()Object.getOwnPropertyDescriptor()Object.getOwnPropertyDescriptors()Object.getOwnPropertyNames()Object.getOwnPropertySymbols()Object.getPrototypeOf()Object.groupBy()Object.hasOwn()Object.is()Object.isExtensible()Object.isFr
HTML DOM APIWindowインスタンスプロパティcachesclosedcookieStorecredentialless Experimental crossOriginIsolatedcryptocustomElementsdevicePixelRatiodocumentdocumentPictureInPicture Experimental event 非推奨; external 非推奨; fence Experimental frameElementframesfullScreen 非標準 historyindexedDBinnerHeightinnerWidthisSecureContextlaunchQueue Experimental lengthlocalStoragelocationlocationbarmenubarmozInnerScreenX 非標準 m
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback const 宣言はブロックスコープのローカル変数(定数)を宣言します。定数の値は代入演算子を使用して再代入することができませんが、定数がオブジェクトであった場合、そのプロパティを追加したり、更新したり、削除したりすることができます。 const number = 42; try { number = 99; } catch (err) { console.log(err); // Expected output: TypeE
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015. Learn moreSee full compatibilityReport feedback splice() は Array インスタンスのメソッドで、その場 (in-place) で既存の要素を取り除いたり、置き換えたり、新しい要素を追加したりすることで、配列の内容を変更します。 元の配列を変更せずに、ある部分を除去したり置き換えたりした新しい配列を作成するには toSpliced() を使用してください。配列を変更せずに配列の一部にアクセスするには slice() を参照してください。 const months
標準組み込みオブジェクトStringコンストラクターString() コンストラクター静的メソッドString.fromCharCode()String.fromCodePoint()String.raw()インスタンスメソッドString.prototype.anchor() 非推奨; String.prototype.at()String.prototype.big() 非推奨; String.prototype.blink() 非推奨; String.prototype.bold() 非推奨; String.prototype.charAt()String.prototype.charCodeAt()String.prototype.codePointAt()String.prototype.concat()String.prototype.endsWith()String.prot
標準組み込みオブジェクトNumberコンストラクターNumber() コンストラクター静的メソッドNumber.isFinite()Number.isInteger()Number.isNaN()Number.isSafeInteger()Number.parseFloat()Number.parseInt()静的プロパティNumber.EPSILONNumber.MAX_SAFE_INTEGERNumber.MAX_VALUENumber.MIN_SAFE_INTEGERNumber.MIN_VALUENumber.NaNNumber.NEGATIVE_INFINITYNumber.POSITIVE_INFINITYインスタンスメソッドNumber.prototype.toExponential()Number.prototype.toFixed()Number.prototype.to
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く