Debugging Value and Condition Issues in JS Object Manipulation

In this meeting, the State Changers collaborated to troubleshoot an issue with the selection and deselection logic in some code. They dig through the code and isolate the issue to a formula, specifically concerning how IDs are selected and unselected. They tackled this problem by leveraging console logs to check what happens when certain actions are made, and they narrowed down the problem to a condition that was continually returning false.


They found that it was due to the code attempting to check whether an ID was included in a list of objects, not a list of IDs. They adjusted the code to use the "find" function instead of "includes" to check through objects for a matching ID property. This adjustment improved the code's functionality but revealed another issue – both the add and remove actions were running in sequence, meaning every time an item was added, it was immediately removed. The team decided that to resolve the issue, they might have to implement two buttons. One for add that disappears after being clicked and another for remove that appears after an item is added. However, recognizing the complexity of this potential solution, they agreed to put the task on hold and revisit it in their next session. No explicit technologies or tools such as Xano, WeWeb, FlutterFlow, etc., were mentioned in the discussion.


(Source: Office Hours 1/26 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free