I already tried using ? after every word, I already tried something like this:
const totalNameLenght = computed(() => {
if (userFirstnameLenght.value && userLastnameLenght.value){
return userFirstnameLenght.value userLastnameLenght.value
}
})
also tried this one:
const totalNameLenght = computed((): number | undefined => )
I don't know what else to try... how should I solve this? Thanks in advance!
CodePudding user response:
you can try:
const totalNameLength = computed(() => {
return Number(userFirstnameLenght?.value ?? 0) Number(userLastnameLenght?.value ?? 0)
})