File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 2727#27: Create a function that takes an array and returns the types of values (data types) in a new array.
2828#28: Create a function that will return in an array. becarefull function parameter and array length is same in count.
2929#29: Create a function that takes the age in years and returns the age in days.
30-
30+ #30: Create a function that takes voltage and current and returns the calculated power.
3131
3232
3333
Original file line number Diff line number Diff line change @@ -419,3 +419,12 @@ const calcAge = (age) => (age < 0 || typeof age != "number" ? null : age * 365);
419419console.log(calcAge(5));
420420
421421```
422+
423+ ** #30 : Create a function that takes voltage and current and returns the calculated power.**
424+
425+ ```
426+
427+ const circuitPower = (voltage, current) => voltage * current;
428+ console.log(circuitPower(115, 5));
429+
430+ ```
Original file line number Diff line number Diff line change @@ -266,8 +266,12 @@ console.log(getArray(5));
266266const getArray = (n) => Array(...Array(n)).map((v, i) => i + 1);
267267console.log(getArray(5));
268268
269- */
270-
271269// #29: Create a function that takes the age in years and returns the age in days.
272270const calcAge = (age) => (age < 0 || typeof age != "number" ? null : age * 365);
273271console.log(calcAge(5));
272+
273+ */
274+
275+ // #30: Create a function that takes voltage and current and returns the calculated power.
276+ const circuitPower = ( voltage , current ) => voltage * current ;
277+ console . log ( circuitPower ( 115 , 5 ) ) ;
You can’t perform that action at this time.
0 commit comments