I want to know the index of the current object when map is used. For example:
x = [3,2,6]
from(x).pipe(
map(index, val => (val, index))
).subscribe((val, index) => console.log(val, index))
Expected output
3, 0
2, 1
6, 2
Basically, I want to know the index of the element in the array. How can I do this?