【发布时间】:2018-04-23 02:33:35
【问题描述】:
这是我的代码:
const prepD = {
name: 'John Smith',
objArr: [
'test',
'Lorem ipsum ' + check() ? 'true' : 'false' + ' rest of text'
]
};
在我的情况下,当check() 返回true 我只得到这个输出:
true,而我应该得到Lorem Ipsum true rest of text。
如果语句为true,为什么要删除剩余的拼接文本以及如何保留全文?
谢谢/
【问题讨论】:
标签: javascript html reactjs ecmascript-6 jsx