Implement some more methods in javascript