How to pass in multiple values for a function to be handled by the methods within the function.

A delete method for js. I want to pass in N values. Could you tell me how to write the method of passing values? I don"t know if it"s okay to use an array. No, no, no.


remove:function (obj) {  
        var obj=[];
        for(var i=0;i<obj.length;iPP){
        obj.parentNode.removeChild(obj)
        };
    }

Obj
    remove(obj.obj.obj......);
Mar.03,2021

use rest parameter to turn the input parameters into an array

remove:function (...obj) {  
        for(var i=0;i<obj.length;iPP){
            obj.parentNode.removeChild(obj)
        };
    }
remove(1,2,3,4,5);

search arguments


1. You can use an array

remove:function (data) {  
        for(var i=0;i<data.length;iPP){
        obj.parentNode.removeChild(data[i])
        };
    }

when calling, obj.remove directly ([1Jing 2Jing 3Jing 4])

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