For every element , check if there is another element which divides it .
for ( let j = 0 ; j < i && arr [ j ] <= Math . sqrt ( arr [ i ] ) ; j ++ ) { if ( arr [ i ] % arr [ j ] == 0 ) { let result = Math . floor ( arr [ i ] / arr [ j ] ) ;