how to check the radius and diameter of a circle in javascript code example Example: javascript perimeter return 2*(length + width); // for a rectangle