Hello. Today I had a question. How can I efficiently create a function that allows me to clean a specific object? For example:
const obj = {
chave1: 'conteudo',
chave2: {},
chave3: '',
chave4: {
chave1: 'conteudo1',
chave2: {}
chave3: {
chave1: [],
chave2: {},
chave3 'conteudo2'
}
}
}
As output would have to exit the following:
{
chave1: 'conteudo',
chave4: {
chave1: 'conteudo1',
chave3: {
chave3: 'conteudo2',
}
}
}
How can I solve the problem without compromising performance?