const list = [12, 5, 80, 34];
const newList = list.filter(function(value) {
  return value <= 50;
});
alert(newList);  // 12,5,34