I have an object listData
with the following values:
{
"TestId": 2,
"CurrentTestVersion": 1,
"TestNumber": "2015-29059",
"SharingData": 1.000000,
"ThresholdValue": 0.0,
"ExpireDate": "2022-12-31T00:00:00",
"UpdateDate": "2021-10-01T00:00:00",
"TestCurrency": "INR",
"TestCode": "44300",
"TestUCode": "",
"IndexType": "LME",
"IndexCode": "EUR",
}
I need to create one more object with only selected fields like:
{
"TestId": 2,
"CurrentTestVersion": 1,
"ThresholdValue": 0.0,
"ExpireDate": "2022-12-31T00:00:00",
"TestCurrency": "INR",
"TestCode": "44300",
"TestUCode": "",
}
I have checked with What is the most efficient way to copy some properties from an object in JavaScript?, which works well with JavaScript but not with TypeScript; any better ways to selectively copy properties?