Sorry I don't know how to search this kinda problem and I didn't find any answer to this but I'm so confused with this code, its a setState function for an OTP verification :
setCode((currCode) =>
currCode
.split('')
.map((ch, i) => (i !== idx ? ch : isCharNumber ? val : isEmpty ? '_' : ch))
.join(''),
);
I understand the map part I'm just wondering about that comma "," after the join function. why? if I delete that the code works but ESlint tell me to put that at the end. does it return an object? it just goes through the state which is "____" (four underscores) and change each _ to digit. I really appreciate if someone explain this to me and tell me how can I search and look for this kind of confusions. ty