I have this objet : keyValue : { key : string , value : number}[];
I want to add a new element to this array from two values, like this :
let tmpTabKV : { key : string , value : number}[];
[...]
tmpTabKV.push({projet.libelle, statKV.value});
[...]
keyValue = tmpTabKV;
I tried multiple syntaxes and seen this : How can I add a key/value pair to a JavaScript object?
But I don't see any key to create a new object. The usage of an Array makes me an error
tmpTabKV.push(Array(projet.libelle, statKV.value));