2👍
✅
You can sort your array:
let search = "Platinum";
arr.sort((x, y) => x == search ? -1 : y == search ? 1 : 0)
An example:
let arr = ["Aluminum", "Basic Materials", "Broad Credit", "Broad Market", "Cocoa", "Coffee", "Consumer Cyclicals", "Consumer Non-cyclicals", "Copper", "Corn", "Cotton", "Crude Oil", "Energy", "Extended Market", "Financials", "Freight", "Gasoline", "Global Macro", "Gold", "Grains", "Health Care", "High Dividend Yield", "High Yield", "Industrials", "Investment Grade", "Large Cap", "Lead", "Livestock", "Long AUD, Short USD", "Long CAD, Short USD", "Long CHF, Short USD", "Long CNY, Short USD", "Long EUR, Short USD", "Long Emerging Markets Basket, Short USD", "Long GBP, Short USD", "Long Global Basket, Short USD", "Long INR, Short USD", "Long JPY, Short USD", "Long SEK, Short USD", "Long SGD, Short USD", "Long USD, Short AUD", "Long USD, Short CHF", "Long USD, Short EUR", "Long USD, Short GBP", "Long USD, Short Global Basket", "Long USD, Short JPY", "Long/Short", "Metals", "Micro Cap", "Mid Cap", "Natural Gas", "Nickel", "Palladium", "Platinum", "Real Estate", "Silver", "Small Cap", "Softs", "Soybeans", "Spreads", "Sugar", "Target Outcome", "Target Risk", "Technology", "Telecommunications", "Theme", "Tin", "Total Market", "Utilities", "Volatility", "Wheat"]
let search = "Platinum";
arr.sort((x, y) => x == search ? -1 : y == search ? 1 : 0)
console.log(arr);
Source:stackexchange.com