Create a function that takes a boolean variable flag and returns it as a string.…
Jump to turn (6)
- 1Create a function that takes a boolean variable flag and returns it as a string.
- 2Create a function that takes the age in years and returns the age in days. Examp
- 3Uchburchakning uchinchi qirrasining maksimal diapazonini topadigan funktsiyani y
- 4Write a class called Point that represents a point in two-dimensional. It should
- 5Create a function that takes a number as an argument, increments the number by +
- 6Create a function that will handle simple math expressions. The input is an expr
- User
Create a function that takes a boolean variable flag and returns it as a string.
Examples boolToString(true) ➞ "true"
boolToString(false) ➞ "false" solve in javascript
- Assistant
function boolToString(flag) { return flag.toString(); }
// Testing the function console.log(boolToString(true)); // "true" console.log(boolToString(false)); // "false"
- User
Create a function that takes the age in years and returns the age in days.
Examples calcAge(65) ➞ 23725
calcAge(0) ➞ 0
calcAge(20) ➞ 7300 solve in javascript
- Assistant