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