0๐
โ
I finally solved my problem.
Solution:( check the length of the array before returning value, to ensure that there is data to be returned. )
getRoomType(assign_id){
return (this.roomTypeName.length > 0)? this.roomTypeName.find(element => element.room_id === parseInt(assign_id)).type :'error';
},
Source:stackexchange.com