If you want to know what role continue plays here, how should you rewrite it if you get rid of it?

    var my_department = [];
                    for (var i = 0; i < aggregations.all_outdept_name.buckets.length; iPP) {
                        if (aggregations.all_outdept_name.buckets[i].key == "") continue;
                        var department_obj = {
                            value: aggregations.all_outdept_name.buckets[i].key,
                            label: aggregations.all_outdept_name.buckets[i].key,
                            count: aggregations.all_outdept_name.buckets[i].doc_count
                        }
                        my_department.push(department_obj);
                    }
                    _this.department = my_department;
Apr.19,2021

continue means to skip this cycle and start the next cycle immediately. In your code, if you execute continue, then the if statement continue will not be executed. A new round of cycle judgment is performed after iPP.

if you want to get rid of it, you can write it backwards, that is, execute the following statement under if continue when the xxx condition is met

.
for (var i = 0; i < aggregations.all_outdept_name.buckets.length; iPP) {
    if (!(aggregations.all_outdept_name.buckets[i].key == '')){
        var department_obj = {
            value: aggregations.all_outdept_name.buckets[i].key,
            label: aggregations.all_outdept_name.buckets[i].key,
            count: aggregations.all_outdept_name.buckets[i].doc_count
        }
        my_department.push(department_obj);
    }
}
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-1b3b2e1-2c27d.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-1b3b2e1-2c27d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?