index.js
/**
 * indexOf: return the index of the first instance of a value
 * 
 * @param {Array} array: elements in an array that might have the same values set in different index
 * @param {*} value: Value that will be used to find its first occurance 
 * 
 * @return {number} : if value given is not in array it will return -1
 * @return {number}: returns index where the value is first seen
 * 
 */
return the index of the first instance of a value

@param {Array} array: elements in an array that might have the same values set in different index
@param {*} value: Value that will be used to find its first occurance

@return {number} : if value given is not in array it will return -1
@return {number}: returns index where the value is first seen
return the index of the first instance of a value @param { Array } array : elements in an array that might have the same values set in different index @param { * } value : Value that will be used to find its first occurance @return { number } : if value given is not in array it will return - 1 @return { number } : returns index where the value is first seen
function indexOf(array,value){
  for (let i = 0; i < array.length;i++){
     let element = array[i];
     if(element === value){
         return i; 
     }
    }
    return -1;
}
function indexOf ( array , value ) { for ( let i = 0 ; i < array . length ; i ++ ) { let element = array [ i ] ; if ( element === value ) { return i ; } } return - 1 ; }
indexOf: return the index of the first instance of a value
indexOf : return the index of the first instance of a value