有史以来最简单的代码行不通-比较true / false语句

时间:2019-09-04 06:13:18

标签: javascript compare

按照您的标准,我是新手,请耐心等待

我到处都尝试了一些小的更改,但是总是像if语句不能正确检查条件。

var WordPOS = require('wordpos'),
    wordpos = new WordPOS(),
    truth = new Boolean();

wordpos.isNoun('tree') // Test if the word "TREE" is a noun
    .then(console.log) //Outputs a true/false statement (TRUE in this case)
    .then(truth) // Write TRUE to the variable

if (truth === true) {
    console.log('yes')
}else{
    console.log('no')
}

// Output looks like this:

// no
// true

0 个答案:

没有答案