20 lines
354 B
JavaScript
20 lines
354 B
JavaScript
//// [symbolProperty23.ts]
|
|
interface I {
|
|
[Symbol.toPrimitive]: () => boolean;
|
|
}
|
|
|
|
class C implements I {
|
|
[Symbol.toPrimitive]() {
|
|
return true;
|
|
}
|
|
}
|
|
|
|
//// [symbolProperty23.js]
|
|
var C = (function () {
|
|
function C() {
|
|
}
|
|
C.prototype[Symbol.toPrimitive] = function () {
|
|
return true;
|
|
};
|
|
return C;
|
|
})();
|