用javasctipt实现完成该方法该方法接受一个布尔值如果为真则返回Yes字符串如果为假则返回No字符串。
function booleanToString(b){
if(b === true){
return "Yes";
} else {
return "No";
}
}
或者更简洁的写法:
function booleanToString(b){
return b ? "Yes" : "No";
}
原文地址: https://www.cveoy.top/t/topic/5zX 著作权归作者所有。请勿转载和采集!