skip to Main Content

Javascript – This code changing the image as expected but not the id?

const currentTypesResult=[{id:'155', foodId:'511555522559744444', image: 'Some image string', example:'example'}] const processedResults = currentTypesResult.map((item) => { const { foodId, image, ...rest } = item; return { id: '5542', image: 'data:image/png;base64,', ...rest }; }); console.log(processedResults[0].id) // Prints 155? Why? Why not 5542? console.log(processedResults[0].image)…

VIEW QUESTION
Back To Top
Search