You can use forEach to get all elements that fit the condition:
const arr = [12,59,42,53,6];
const x = 24;
const y = 4;
arr.forEach(function(item, index){
if(item * y === x) {
console.log(item, index);
}
});
solved Determine which element of an array will make IF statement return true Javascript [closed]