[Vuejs]-Which would be the proper way to iterate this Array of objects and remove the ones with item.text = null || item.text = ''?

1👍

In js, any value can be tested in order to know if it is "something", so you can test null, undefined or even 0 or '' which will all result in a false evaluation, this can so solve your problem :

const contactInfoFiltered = computed(() => contactInfo.value.filter(info => info))

Leave a comment