variable key name js how to use variable as object key in typescript

The solution for “variable key name js how to use variable as object key in typescript” can be found here. The following code will assist you in solving the problem.

//You need to make the object first, then use [] to set it.

var key = “happyCount”;
var obj = {};
obj[key] = someValueArray;
myArray.push(obj);var key = “happyCount”;
var obj = {};
obj[key] = someValueArray;

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in