Return multiple values in JavaScript?

前端 未结 20 1991
暖寄归人
暖寄归人 2020-11-22 13:17

I am trying to return two values in JavaScript. Is this possible?

var newCodes = function() {  
    var dCodes = fg.codecsCodes.rs;
    va         


        
20条回答
  •  粉色の甜心
    2020-11-22 14:01

    I am nothing adding new here but another alternate way.

     var newCodes = function() {
         var dCodes = fg.codecsCodes.rs;
         var dCodes2 = fg.codecsCodes2.rs;
         let [...val] = [dCodes,dCodes2];
         return [...val];
     };
    

提交回复
热议问题