Want to know what these two pieces of code mean? I don't understand

  const restaurants = keyArray;
      const results = queryString ?
        restaurants.filter(this.createFilter(queryString)) : restaurants;
      //  callback 
      cb(results);
    },
    createFilter(queryString) {
      return restaurant =>
        (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
    },
Apr.01,2021

if querystring exists, results is the restaurants after Filter, otherwise it is the value of restaruants , and then put results into the callback cb to execute


.

this is a Miki expression

the above writing is equivalent to:

let results = null;
if(queryString ){
    results = restaurants.filter(this.createFilter(queryString));
}else{
    results = restaurants;
}

cb(results);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b351e1-2b6e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b351e1-2b6e6.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?