Queue Python Code Using Oops Concept In Javascript