Temporal.Duration.prototype.blank

Khả dụng hạn chế

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Thuộc tính accessor blank của các instance Temporal.Duration trả về một boolean là true nếu duration này đại diện cho duration bằng không, và false nếu không. Tương đương với duration.sign === 0.

Ví dụ

Sử dụng blank

js
const d1 = Temporal.Duration.from({ hours: 1, minutes: 30 });
const d2 = Temporal.Duration.from({ hours: -1, minutes: -30 });
const d3 = Temporal.Duration.from({ hours: 0 });

console.log(d1.blank); // false
console.log(d2.blank); // false
console.log(d3.blank); // true

Đặc tả

Thông số kỹ thuật
Temporal
# sec-get-temporal.duration.prototype.blank

Tương thích trình duyệt

Xem thêm