To find the perimeter of a rectangle, add the lengths of the rectangle’s four sides. If you have only the width and the height, then you can easily find all four sides (two sides are each equal to the height and the other two sides are equal to the width). Multiply both the height and width by two and add the results.
How do you write a parameter?
We can create a procedure with parameters to handle both the repetition and the variance. To specify parameters in JavaScript, we write the name of the parameter (or parameters) inside the parentheses that come after the function name. We then reference that parameter name inside the function.
What is a parameter in code?
In computer programming, a parameter or a formal argument is a special kind of variable used in a subroutine to refer to one of the pieces of data provided as input to the subroutine.