Category : recursion

I am creating a side hierarchy for controlling all my Modal usage in the app import ReactNativeModal, { ModalProps } from ‘react-native-modal’; export const ModalsProvider = ({ children }: { children: ReactNode }) => { const [modals, setModals] = useState<IModal[]>([]); const [modalsMap, setModalsMap] = useState({}); const isModalsExist = useMemo(() => !!modals.length, [!!modals.length]); useEffect(() => { ..

Read more

const tree = [ { id: "a3b1-2158-e5dd-66d7", name: "trbytyu", type: "directory", path: "trbytyu/", children: [ { id: "e4b7-68e4-15c8-7f97", name: "inventory.yaml", type: "file", path: "trbytyu/inventory.yaml", }, ], }, { id: "fdca-3823-fccf-5218", name: "model", type: "directory", path: "model/", children: [ { id: "a890-585c-2e67-e517", name: "model.yaml", type: "file", path: "model/model.yaml", }, { id: "dbeb-fdbe-3039-6e2f", name: "storage-complextypes.yaml", type: "file", ..

Read more

I managed to either trigger bug in one of libraries that I used or I passed invalid data there. Fine, it happens. But to diagnose what happened it would be nice to know where I actually call this library function! But Firefox "helpfully" truncated stack trace. How can I get access to a full stack ..

Read more

everyone! Please help me to understand some steps of the program execution.The essence of the program is that we have an initial number, for example number 13, and using recursion we create an expression as (((1 * 3) + 5) + 5). This program is from the textbook and there is no error in it. ..

Read more

I need help implementing a software solution for the following task: Namely, the point is that I need advice on how to logically write program code in JavaScript. The function should for the following array: [ {"id":1,"prev":["NaN"]}, {"id":2,"prev":["NaN"]}, {"id":3,"prev":[1]}, {"id":4,"prev":[2]}, {"id":5,"prev":[2]}, {"id":6,"prev":[3,4]}, {"id":7,"prev":[5,6]} ] find each possible option of ordering the elements in the list. ..

Read more