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