var a=[1,2,3,4,5,6]
console.log(a.indexOf(3))

var b=[1,2,3,4,5,6,2,3,4,3,3]
console.log(b.lastIndexOf(3))

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: