//Opción 1: function booleanToString(b){ return b.toString(); } //Opción 2: function booleanToString(b){ return b ? 'true' : 'false'; } // si b es true? devolver 'true' si no lo es devolver 'false'. //Opción3: function booleanToString(b){ return String(b); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter