dashman dashman - 2 months ago 15
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

This will fix your problem

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