dashman dashman - 9 months ago 77
TypeScript Question

Adding properties to an empty object

I have this code

var MY_OBJ = {};
MY_OBJ.test = function(){}

and I'm using Vscode, I get property test not defined.
How do I let this be just a warning.


This will fix your problem

var MY_OBJ:any = {};
MY_OBJ.test = function(){}