Returns the id of a task or nil if the task is removed (empty).
Notice that every task will be stored, thus all new tasks will get an Id. Only when a task is successfully finished or removed using del(), the task will be empty and therefore the Id will be nil.
This function does not generate a change.
task.id()
None
Returns id of a task or nil if the task is removed (empty).
This code uses
id()to return a task id:
t = task(datetime().move('days', 1), ||log('Dummy task'));
t.id(); // Returns the Id of the task.
Example return value in JSON format
624