How does js execute object functions in turn? the number of functions is uncertain.

as follows, functions need to be added frequently and executed sequentially. Each function renders a different class, after the result is obtained, so it needs to be executed in turn, and some parameters need to be passed in

let testcase = {

case1:(x) =>{
    console.log("case11-"+x);
},
case2:() =>{
    console.log("case22");
    return false;
},
case3:() =>{
    console.log("case33");
}
.....

}

Mar.24,2021

is best written as an array, and object property traversal is unordered. If you want to write as an object, first make sure that you can use sort to sort out the order you want (naming convention or attribute convention), and then you can traverse and execute it in turn.


on the same floor, it is best to use arrays to organize your structure to ensure that traversing is orderly.

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-1eab57d-204f.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-1eab57d-204f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?