xxxxxxxxxx
const compareValue = 13;
const data = {
id: 1,
compareValue > 10 && {propertyForGreaterThan10: 'foo'}), (
compareValue < 10 && {propertyForLessThan10: 'bar'}), (
}
// Result:
// {
// "id": 1,
// "propertyForGreaterThan10": "foo"
// }