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))
Source:stackexchange.com