Highlight: size プロパティ
Baseline 2025Newly available
Since June 2025, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
値
size
の値は、ハイライトオブジェクトが持っている項目数を表す読み取り専用の整数です。
例
size の使用
js
const highlight = new Highlight();
highlight.add(range1);
highlight.add(range2);
highlight.add(range3);
console.log(highlight.size); // 3
仕様書
Specification |
---|
ECMAScript® 2026 Language Specification # sec-get-set.prototype.size |