Is there a more efficient way to retrieve only 3 items from an array?
If you have any suggestions, I would appreciate it! Thank you.
loadAsk!: Observable<any[]>;
this.loadAsk.pipe(
map(arr => arr.sort(() => Math.random() - .5)),
map((item: any[]) => [item[0], item[1], item[2]])
).subscribe(res => {
//code
})