Js replaces the elements in the array according to the identity?

I will get an array, such as: [1], then 1 corresponds to apple, 2 corresponds to watermelon, and 3 corresponds to durian.
what I can think of for the time being is:

        let arr = this.checkboxGroup1
        for(let k in arr){
            if(arr[k] == 1){
                arr[k] = ""
            }else if(arr[k] == 2){
                ....
            }
            ....
        }
        

in fact, my array may have 20 elements. It will be troublesome to write this. Please give me some advice on the simple method

.

the final requirement is to get an array of pure fruit to display


do relational mapping first:

let tag={
    "1":"",
    "2":"",
    "3":""
}
let arr=[1,2,3]
for(let i=0;i<arr.length;iPP){
    console.log(arr[i]+":"+tag[arr[i]])
}
Menu