C
C#10mo 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
Pobiega10mo ago
That's JavaScript
Thinker
Thinker10mo ago
$js
Emelie
Emelie10mo ago
ah, you mean to tell the programme its not just returning plain elements?
Pobiega
Pobiega10mo 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
Emelie10mo ago
oh sorry! I didnt realize
Thinker
Thinker10mo ago
check this server for JS questions
Accord
Accord10mo 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.