What does a comma do in assignment statements in JavaScript?

前端 未结 4 1167
盖世英雄少女心
盖世英雄少女心 2020-12-10 14:32

I found this in a piece of code and i\'m wondering what it does? Assign b to x... but what\'s with the ,c?

var x = b, c;
4条回答
  •  粉色の甜心
    2020-12-10 15:08

    That defines two local variables x and c - while setting x's value equal to the value of b.

提交回复
热议问题