Why does this JavaScript work?

前端 未结 4 1414
难免孤独
难免孤独 2021-01-17 08:27

I was looking at the output of some stuff from UglifyJS and happened across some code like the following:

var a = 0;
var b = function () {
    return functio         


        
4条回答
  •  萌比男神i
    2021-01-17 08:47

    Check out the comma operator in JavaScript.

    The comma operator evaluates both of its operands (from left to right) and returns the value of the second operand.

提交回复
热议问题