Javascript json 데이터의 key 이름 바꾸기
const jsonData = { group_id: selectedCategoryId,};// Transform the keyconst updatedJsonData = Object.fromEntries( Object.entries(jsonData).map(([key, value]) => key === 'group_id' ? ['attach_id', value] : [key, value] ));console.log(updatedJsonData);
2025.01.19