I was trying to access the task at level 2 and greater, does the dp.tasks.list.find() work after level1.
Was able to access the level0 and level1 item but after that it gives a null value.
The tasks.list property contains the original array of tasks. Its find() method is the standard Array.prototype.find() method, which searches through the array items.
To find a task by its ID within the entire task tree, you can use the tasks.find() method.
Oh, I got confused. I’m using the tasks.find() method to access the items. But after level 2, it is giving null value.
I can access the level 0 and 1 tasks by this method. Does the tasks.find() searches the whole tree?
Yes, the tasks.find() method searches the whole tree. You might want to check the task IDs to see if the values are what you expect. Please note that the ID must fully match the tasks.find() argument, including type (i.e. 3 !== "3").
3 !== "3"