JS Dapatkan semua indeks nilai dalam array
// find all indexes in array that match value
let indices = array.map((e, i) => e === value ? i : '').filter(String)
MrStonkus
// find all indexes in array that match value
let indices = array.map((e, i) => e === value ? i : '').filter(String)
var list = ["apple","banana","orange"]
var index_of_apple = list.indexOf("apple") // 0