const max = new CSSMathMax(CSS.px(10), CSS.em(5), CSS.percent(50));
console.log(max.constructor.name); // "CSSMathMax"
console.log(max.operator); // 'max'
console.log(max.values); // CSSNumericArray {0: CSSUnitValue, 1: CSSUnitValue, 2: CSSUnitValue, length: 3}
console.log(max.values[0]); // CSSUnitValue {value: 10, unit: "px"}CSSMathMax: CSSMathMax() constructor / notebook
CSSMathMax: CSSMathMax() constructor
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
try {
// Mixes a length (px) with a time (s): incompatible types
new CSSMathMax(CSS.px(10), CSS.s(2));
} catch (e) {
console.log(e instanceof TypeError); // true
console.log(e.message);
}try {
new CSSMathMax();
} catch (e) {
console.log(e instanceof DOMException); // true
console.log(e.name); // "SyntaxError"
}