For instance, a variable named arrayElements of array type contains [1,2,3,4].
How do i get the position of which that has the value \"3\" in the array variable besi
Or simple use a for loop:
function getPosition(elementToFind, arrayElements) { var i; for (i = 0; i < arrayElements.length; i += 1) { if (arrayElements[i] === elementToFind) { return i; } } return null; //not found } getPosition(3, [1, 2, 3, 4]);