dashman dashman - 1 year ago 128
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.

Answer Source

This will fix your problem

var MY_OBJ:any = {};
MY_OBJ.test = function(){}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download