javascript perimeter

JavaScript
return 2*(length + width); // for a rectangle
Source

Also in JavaScript: