There are two different methods for using objects in programming. I am curious to understand if the difference lies in the syntax or if there is more to it.
Method 1
body(data) = {
item1: data.val1;
item2: data.val2;
item3: data.val3;
}
Method 2
body(data) = {
item1 = data.val1,
item2 = data.val2,
item3 = data.val3
}
body.item1 = '';
body['item2'] = '';