0
var checking_location = "none"
const getentitiesByType = (arr, type) => {
for (let i in arr) {
if (arr[i].type === type) {
checking_location = "exists"
return arr[i].entity
}
}
return null;
}
if (!meeting.location) {
if (checking_location != 'exists') {
rl.question('where is the location ', function(answer) {
// session.send("The location you gave:" answer);
rl.close();
session.send(answer)
// console.log(tryagain(answer, 'Calendar.Location'));
session.send(tryagain(answer, 'Calendar.Location'));
});
}
} else {
next();
}
私がここでやろうとしているのは、checking_location
がnone
に等しい場合、if (!meeting.location)
にループを持つことです。基本的には、Json
フィールドが存在するかどうかをチェックしたいのですが、もし私がrl.question
の質問をし続けたいのであれば、私の問題はコードが最初にしか動かないということです。必要なフィールドは私はその質問を取得しません。また、これはコード全体ではないことに注意してくださいが、私の実装で考えられる問題のスポットを理解する以上のものです。2番目のコードセクションに「if」が埋め込まれていないのはなぜですか?
'getentitiesByType'は呼び出されず、ループを持つ唯一の場所です。 –
私の悪い、私は2番目の埋め込みを意味する場合、私はそれを反映するために私の質問を調整します。 – Alex