I want to convert a typescipt object to JSON
ObjectToConvert = { key : value }
public getJson(key: string, value: string) {
//I passed this values when I called the method : key="attr",value="on"
console.log(JSON.stringify({ ObjectToConvert }))
// The result is {"key":"on"} instead of {"attr":"on"}
I want to know why the result is not what I passed as parameter.