get array accoding to indice js code example Example: get array by array of indices js var resultArr = indexArr.map(i => fruitier[i])