I have an object lengthOfStay in which I'm trying to concatenate the values inside it and put it on customerApplication.lengthOfStay
lengthOfStay:{
yrs: '',
mos:''
},
customerApplication: {
length_of_stay: this.lengthOfStayYrsMos
}
computed: {
lengthOfStayYrsMos(){
return this.customerApplication.length_of_stay =
Object.keys(this.lengthOfStay).map(k => this.lengthOfStay[k]).join(" ")
}
}
so for the concatenation looks good and the result for example is
lengthOfStay:{
yrs: '2',
mos:'2'
},
//result
customerApplication: {
length_of_stay: "2 2"
}
how can I concatenate a string on it ? so that the result would be
customerApplication: {
length_of_stay: "2 Yrs. & 2 Mos."
}