← Back to challenges

Boolean to String Conversion

JavaScriptMediumbit_operationsconditionslogicstrings

Instructions

Create a function that takes a boolean variable flag and returns it as a string.

Examples

boolToString(true) ➞ "true"

boolToString(false) ➞ "false"
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.