DEV Community

Discussion on: The challenge to make a shape area calculation in CodeSignal

Collapse
 
kikeflowers profile image
kikeflowers

function shapeArea(n) {
var res = 1;
for(let i = 1; i < n; i++){
res = res + (i*4)
}
return res;
}