Create a function that takes voltage and current and returns the calculated power.
Examples:circuitPower(230, 10) ➞ 2300
circuitPower(110, 3) ➞ 330
circuitPower(480, 20) ➞ 9600
Notes:
Requires basic calculation of electrical circuits. Power = voltage * current;
We will use this calculation in our function.
<script>
function circuitPower(voltage, current){
let power = voltage * current;
return power;
}
var voltage = 220;
var current = 10;
var power = circuitPower(voltage, current);
console.log(power); // You can copy this code and print in your IDE to view 2200 in your console.
</script>