如何从扩展运算符中删除属性?

By simon at 2019-05-16 • 0人收藏 • 29人看过

我想从响应中删除 drugName,但是没有办法从 spread 操作符中删除属性吗? 4. main.js

Const transformedResponse transformedResponse (response) ; const loggerResponse { ... transformedResponse } ; delete loggerResponse [ drugName ] ; console.log ("LOGGER",loggerResponse) ; LOGGER (). 信息('Drug Price Response',{ ... loggerResponse,memberId: memberId,pharmacyId: pharmacyId }) ;

数据

0': { isBrand: false,drugName: test drug,drugStrength:'5 mg 15 mg',drugForm: Tablet',}

转换响应

{药名:'HYDROCODONE-HOMATROPINE MBR',drugStrength:'5MG-1.5 MG',drugForm:'TABLET',brand: false }]

登录后方可回帖

Loading...