Return multiple values in JavaScript?

前端 未结 20 2011
暖寄归人
暖寄归人 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 13:58

    All's correct. return logically processes from left to right and returns the last value.

    function foo(){
        return 1,2,3;
    }
    
    >> foo()
    >> 3
    

提交回复
热议问题