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

Map list of JSON to Tabbar flutter

I'm trying to map list of json to tab bar, and want tab bar title as "JSON1" API response :"data": [{"JSON1": {"key1": "val1","key2": "val2"}}], My code : List dataResponse = [{JSON1: {key1: val1, key2: val2}}]; TabBar( tabAlignment: TabAlignment.start, indicatorSize: TabBarIndicatorSize.tab,…

VIEW QUESTION
Back To Top
Search