原生js:逗号运算符

85 阅读1分钟

在表达式中,会返回最后一个逗号右边的值作为表达式的结果

      const f =
        (function f() {
          return '1'
        },
        function g() {
          return 2
        })
      console.log(typeof f) // function
      console.log(typeof f()) // number