C
C#15mo ago
Emelie

❔ Why is destructuring used like this?

Hi, I am trying to get a grasp on a code example I found on the tic-tac-toe game. One thing I struggle to understand, is why the parameters defined for this function are contained within curly brackets. Why not just the paranthesis?
No description
8 Replies
Pobiega
Pobiega15mo ago
That's JavaScript
Thinker
Thinker15mo ago
$js
Emelie
EmelieOP15mo ago
ah, you mean to tell the programme its not just returning plain elements?
Pobiega
Pobiega15mo ago
That syntax means it takes in an object with those 4 properties No I mean this is a C# discord You are asking a JavaScript question
Emelie
EmelieOP15mo ago
oh sorry! I didnt realize
Thinker
Thinker15mo ago
check this server for JS questions
Accord
Accord15mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server