solutions of javascript questions