TypeScript uses {} for object declaration.

class Point {
    x: number;
    y: number;
    private myAdd = function(x: string, y: string): void { console.log(x + y); }
    Invoke(x, y) { this.myAdd(x, y) }
}
let point:Point = {x:0,y:10, 
     myAdd (x: string, y: string): void { console.log(x + y); },
    Invoke(x, y) { this.myAdd(x, y) }};

error message: error TS2322: Type"{x: number; y: number; myAdd (x: string, y: string): void; Invoke (x: any, y: any): void;}"is not assignable to type "Point".
Property" myAdd" is private in type "Point" but not in type" {x: number; y: number; myAdd (x: string, y: string): void; Invoke (x: any, y: any): void;}".

does a class with a private property/function can only declare objects with a constructor?

Mar.23,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e528b8-276fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e528b8-276fb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?