a javascript code to demonstrate the concept of the task manager