skip to Main Content

How to set array key that does not exist yet in javascript? – Jquery

My problem is Uncaught TypeError: Cannot set properties of undefined (setting 'quantity') when I iterate over response array. $.ajax({ url: "/cart/sync", success: function(response){ let cart = {}; Object.keys(response).forEach(key => { cart[key].quantity = response[key].product_quantity; cart[key].discounted_price = response[key].product_discounted_price; cart[key].holding = response[key].product_temp_holding; });…

VIEW QUESTION

Why i cant see the values of my snapshot.value from firebase database in a Text widget in flutter?

i have the next code: DatabaseReference ref = FirebaseDatabase.instance.ref(); late DatabaseReference databaseReference; final data = FirebaseDatabase.instance.ref(); var medsValues; _activateListeners() { data.get().then((snapshot) { var medsDescription = snapshot.value; setState(() { medsValues = medsDescription; }); }); } ListView.builder( itemCount: medsValues.length, itemBuilder: (BuildContext context,…

VIEW QUESTION
Back To Top
Search