I have something very strange happening...I have an array called destinations which takes objects with a dest, an amount and a memo.
My code is the following:
- I have a variable "element" which (when logged to the console) is a string with value "xNUSrBmqocfTinhSZVV6vLtwzaWasCoYuTUqnERPYjd8CAj3TtAf3hTvsNzoeYRY5b4qFGBS4mZhpXiJDghMKMGuJeD4Qy74ZCe9oMreUuwcRKQVKjj55LUEbnSDPtzH71gyPuT1ft3"
- But when I create an object and set the dest to this variable and push this object into the destinations array, it suddenly isn't the string above anymore but an object... (take a look at the attached screenshot to see the outputs of the console.logs)
const destinations: { dest: string | never[]; amount: number; memo: string; }[] = [];console.log("ELEMENT")console.log(element)console.log("-----")destinations.push( { dest: element, amount: 1 * 1e8, memo: JSON.stringify(poll), }) console.log("DESTINATIONS")console.log(destinations)console.log("-----")
Why is this happening?
Thanks in advance