Seventh exercise of javascript