Table of Contents
show
Example 7:
Calculate the area of a rectangle and store the width and height in variables. Then, create a variable called “area” and calculate the area using the formula: area = width * height.
let width = 5;
let height = 6;
let area_rect = width * height;
console.log("Area of rectangle : ", area_rect);
Output:
Views: 98