Skip to content

Commit 5d66a9f

Browse files
Refactor.
1 parent 8c6b249 commit 5d66a9f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ const backChain = function(goal, assertions) {
5555
let isPremiseAssertionTrue = true;
5656

5757
while (!allPremisesTrue && isPremiseAssertionTrue) {
58-
const nextGoal = premise;
59-
60-
trueAssertion = backChain(nextGoal, assertions);
58+
// Satisfy the current premise as the next goal.
59+
trueAssertion = backChain(premise, assertions);
6160

6261
// Add the assertion to the assertion list.
6362
trueAssertion && assertions.push(trueAssertion);

0 commit comments

Comments
 (0)