string variable result shows a message " rectangle.drawr[undefined] is not a function"