return index of largest element in array javascript code example Example: javascript index of biggest number arr.indexOf(Math.max(...arr))