数组转对象

    1. const fruits = ["banana", "apple", "orange", "watermelon"];
    2. const fruitsObj = { ...fruits };
    3. // {0: "banana", 1: "apple", 2: "orange", 3: "watermelon"}