================================================================================= Consider the following code: -------------------------------------------- function getList() { return ['a', 'b', 'c']; }; // get the list const list=getList(); // rotate an item in the list list.push(list.shift()); // output the list console.log(1,list); // outout the list returned by getList() console.log(2,getList()); -------------------------------------------- No.1 and No.2 list are different. ================================================================================= ================================================================================= Now consider this code: -------------------------------------------- function getList() { // the following the initalization of the list runs only the first time. const list=['a', 'b', 'c']; // redefine the getList function getList=function(){return list;} // return the getList function return getList(); } // get the list const list=getList(); // rotate an item in the list list.push(list.shift()); // output the list console.log(1,list); // outout the list returned by getList() console.log(2,getList()); -------------------------------------------- This time No.1 and No.2 list are the same. because the inializaion runs only one time. =================================================================================