A js type interview question, do not understand what to do? Ask for answers

Please write a js program that defines a list class List, that consists of two members: attribute length (representing the number of elements in the list) and method add (adding elements to the list), where the parameters of the constructor and add method are required to be dynamic.

Feb.26,2021


ES5

function List1(){            
            this.items = [];
            for(var i =0; i<arguments.length;iPP){
                this.items.push(arguments[i]);
            }
            this.length = arguments.length;
            this.add = function(){
                for(var i =0; i<arguments.length;iPP){
                    this.items.push(arguments[i]);
                }
                this.length = this.items.length;
            }
        }
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-1b31426-2bd8a.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-1b31426-2bd8a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?