小红花·文摘
首页
广场
排行榜
🏆
直播
FAQ
首页
详情
DEV Community
·
2025-04-22T04:00:00Z
将布尔值转换为字符串 '是' 或 '否'.
💡
原文英文,约100词,阅读约需1分钟。
📝
内容提要
该函数接收布尔值,使用三元运算符判断参数是否为真,返回“是”或“否”。
🎯
关键要点
该函数接收布尔值作为参数。
使用三元运算符判断参数是否为真。
如果参数为真,返回'是';否则返回'否'。
这是一个8kyu等级的CodeWars挑战。
🏷️
标签
三元运算符
函数
字符串
布尔值
返回值
阅读原文
生成长图
分享链接
已复制链接
➡️
继续阅读
Rivian’s revenue is up as R2 production kicks into gear
Rivian reported its first quarter earnings of 2026, providing us a closer loo...
Rivian downsizes its goals for its EV factory in Georgia
Rivian announced some changes today with regard to the factory its building i...
The logic of the racist Supreme Court isn’t adding up
Close watchers of the Supreme Court knew that the conservative supermajority ...
人工智能沙箱正迎来其Kubernetes时刻
Recently, Anthropic announced that its new model, Mythos, had autonomously fo...
微软的Xbox模式现已在所有Windows 11 PC上可用
Microsoft is now rolling out its Xbox mode to all Windows 11 PCs. The new Xbo...
Meta威胁称,如果被迫进行“技术上不可行”的更改,将撤回其在新墨西哥州的应用程序
Meta公司表示,如果新墨西哥州检察长的要求得以实施,他们可能会撤回Facebook、Instagram和WhatsApp。检察长要求的多项变更被Meta...
👤 个人中心
在公众号发送验证码完成验证
去登录
登录验证
在本设备完成一次验证即可继续使用
×
完成下面两步后,将自动完成登录并继续当前操作。
1
关注公众号
小红花技术领袖
如果当前 App 无法识别二维码,请在
微信
搜索并关注该公众号
2
发送验证码
在公众号对话中发送下面 4 位验证码