-1
Assuming I have the following object below
const teste = {
onload: ()=> {
console.log('a')
}
}
Where the onload attribute is a function, and I need it to be transformed into a string so that I can use it in another place by passing it back to object, but I do:
console.log(JSON.stringify(teste))
I have as a result {}
It would have some way to convert every object including the functions in it, into a string?
Why do you need to convert it into a string? It wouldn’t be easier to send the function reference?
– Andre