locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
12 lines (11 loc) • 454 B
JavaScript
export function FormatBool(b) {
// discuss at: https://locutus.io/golang/strconv/FormatBool
// parity verified: Go 1.23
// original by: Kevin van Zonneveld (https://kvz.io)
// note 1: Returns "true" or "false" according to the value of b.
// example 1: FormatBool(true)
// returns 1: 'true'
// example 2: FormatBool(false)
// returns 2: 'false'
return b ? 'true' : 'false';
}