parameter underscore

이서현·2022년 6월 25일
0
LIST.map((_,index) => {...})

언더스코어...
처음 봤을 땐 귀찮아서 대충 넣은 줄 알았는데
이유가 있었다

Not exactly. () says that the function does not expect any arguments, it doesn't declare any parameters. The function's .length is 0.
If you use _, it explicitly states that the function will be passed one argument, but that you don't care about it.
출처

profile
🌿💻💪🧠👍✨🎉

0개의 댓글