From 5031b6402a5d23c9fe5269c6a135f453c834d8d9 Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Wed, 19 Apr 2023 13:16:06 -0400 Subject: [PATCH] var names --- random.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/random.js b/random.js index 3d11243..a5903fd 100644 --- a/random.js +++ b/random.js @@ -39,7 +39,7 @@ const breakDown = (node)=>{ return node; } -const tree = breakDown({value:7}); +const tree = breakDown({value:5}); console.dir(tree, {depth:null}); @@ -47,16 +47,16 @@ const getLeaves = (node)=>{ if(node.twoPath === undefined){ return node.value; } - const twoLeftValue = getLeaves(node.twoPath.left); - const twoRightValue = getLeaves(node.twoPath.right); + const twoPathLeftValue = getLeaves(node.twoPath.left); + const twoPathRightValue = getLeaves(node.twoPath.right); if(node.threePath !== undefined){ - const threeLeftValue = getLeaves(node.threePath.left); - const threeRightValue = getLeaves(node.threePath.right); - return [[twoLeftValue, twoRightValue], [threeLeftValue, threeRightValue]]; + const threePathLeftValue = getLeaves(node.threePath.left); + const threePathRightValue = getLeaves(node.threePath.right); + return [[twoPathLeftValue, twoPathRightValue], [threePathLeftValue, threePathRightValue]]; } - return [twoLeftValue, twoRightValue]; + return [twoPathLeftValue, twoPathRightValue]; } const leaves = getLeaves(tree);