2023-01-19 Vue slice():從數組中返回選定(擷取)的元素,作為一個新數組。 slice():從數組中返回選定(擷取)的元素,作為一個新數組。參數(開始,結束但不包括) const fruits = ["Banana", "Orange", "Lemon", "Apple", "Mango"]; const citrusSlice = fruits.slice(1, 3); //Orange,Lemon Newer reverse():反轉一個陣列。 Older findIndex():方法將依據提供的測試函式,尋找陣列中符合的元素,並返回其 index(索引)。如果沒有符合的對象,將返回 -1