JavaScript Decision Tree tool

My goal has been to make a JavaScript Decision Tree tool as a new content module for our next site redesign.

It needs to work such that the same piece of JavaScript can be utilised without modification for any decision tree tool we build on the site, with a very simply-defined markup structure,

So I’ve been self-administering repeated doses of headdesk/facepalm over the last couple of days, but I came back today after a Friday lunch (you know what I mean) and found a solution. It’s not pretty, with at least two nested ‘for’ loops, but it works.

I’ve created a JSFiddle of it, so you can take a look at it, modify it, laugh at it, etc.
Open it in JSFiddle or see it embedded below:

This entry was posted in Coding, JavaScript. Bookmark the permalink.

197 Responses to JavaScript Decision Tree tool

  1. ????????? says:

    On November 10, the team running the FTX Future Fund, an ostensibly charitable group bankrolled by Bankman-Fried, announced that they had resigned earlier that day.

  2. ???????? says:

    Additionally, the initial melding requirement must be met without any wild cards.

  3. makan seblak says:

    Thank you for the auspicious writeup. It in fact was a amusement account
    it. Look advanced to more added agreeable from you!
    However, how could we communicate?

  4. David Goren, a veteran radio producer who’s created programming for Nationwide Public Radio, has spent years learning pirate broadcasters.

  5. Hey! This post couldn’t be written any better! Reading this post reminds me of my old room mate! He always kept chatting about this. I will forward this write-up to him. Fairly certain he will have a good read. Thank you for sharing!

  6. Thanks for the article. My partner and i have always noticed that the majority of people are desirous to lose weight when they wish to show up slim as well as attractive. However, they do not generally realize that there are more benefits for losing weight also. Doctors declare that fat people are afflicted with a variety of ailments that can be directly attributed to their own excess weight. The great thing is that people that are overweight and suffering from diverse diseases can reduce the severity of their particular illnesses simply by losing weight. It is easy to see a steady but noticeable improvement in health when even a slight amount of fat loss is accomplished.

  7. nhk???? ??6? says:

    How to Make the Best of a Bear Market?

  8. Thank you, I’ve recently been searching for information about this subject for ages and yours is the greatest I’ve discovered so far. But, what about the conclusion? Are you sure about the source?

  9. A lot of of whatever you articulate happens to be supprisingly precise and that makes me wonder the reason why I had not looked at this with this light before. This article really did switch the light on for me personally as far as this specific topic goes. Nonetheless at this time there is one issue I am not necessarily too cozy with and while I try to reconcile that with the actual main theme of the issue, permit me observe what all the rest of the subscribers have to point out.Well done.

  10. ??? says:

    You then cut and shape all of those parts to get the specified look for the automobile.

  11. ?? ?? ?? says:

    EF2 to EF3 harm occurred in this space as multiple homes sustained main structural injury or were destroyed, metal power poles had been snapped, cell properties were obliterated, and lots of large bushes had been snapped and twisted.

  12. They can sell generics at these low prices because they never spent the money advertising the brand in the first place.

  13. WW88 says:

    This site is known as a walk-via for the entire data you needed about this and didn?t know who to ask. Glimpse right here, and also you?ll definitely discover it.

  14. ???? ?? says:

    The aquatic vitality merely shimmers on this modern, minimalist bathroom.

  15. WW88 says:

    Pretty nice post. I just stumbled upon your weblog and wanted to say that I’ve truly enjoyed browsing your blog posts. After all I will be subscribing to your rss feed and I hope you write again very soon!

  16. ?????? says:

    You wish to play against such a robust program that you have no likelihood.

  17. ????? ??? says:

    Investors who had purchased 10-year Treasuries in 2006 would have received a safe and steady yield until 2015, possibly achieving better returns than those investing in equities during that volatile period.

  18. U888 says:

    Undeniably imagine that that you stated. Your favorite justification seemed to be at the internet the easiest thing to bear in mind of. I say to you, I certainly get annoyed at the same time as folks consider concerns that they just don’t know about. You managed to hit the nail upon the highest and defined out the entire thing with no need side effect , other people could take a signal. Will likely be back to get more. Thank you

  19. ??????2024 says:

    Child mortality, life expectancy, primary and secondary school enrollment, and literacy rates have improved dramatically in the past thirty years, while average per capita income growth has been around 2 per year since 1980 resulting in an increase in unemployment rates and poverty rates.

  20. WW88 says:

    It’s best to take part in a contest for one of the best blogs on the web. I’ll suggest this website!

  21. Nice blog here! Also your website loads up very fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  22. tdr ???? says:

    I could see his wheels spinning.

  23. Thanks for the guidelines you have contributed here. One more thing I would like to mention is that computer memory demands generally rise along with other innovations in the engineering. For instance, whenever new generations of cpus are introduced to the market, there is certainly usually an equivalent increase in the type calls for of all personal computer memory along with hard drive space. This is because the software program operated by means of these processors will inevitably rise in power to leverage the new know-how.

  24. 7494 ?? says:

    Permaculturists plant a wide range of crops with this in thoughts, growing fruit and nut-bearing timber alongside short-lived food plants.

  25. bookmarked!!, I like your blog!

  26. ??????? ???? says:

    For the reason that historical instances, using jewels has been fairly common in society.

  27. I found your blog web site on google and examine a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Searching for forward to studying extra from you in a while!?

  28. ??????????? says:

    A blood red shrimp, a squid with an octopus with two enormous fins (they’re affectionately referred to as Dumbo octopuses) and a hermit crab with vivid inexperienced eyes were also among the crew’s finds.

  29. MinSwap says:

    Discover the power of MinSwap, the leading decentralized exchange platform offering seamless trading and low fees. Maximize your assets and join the next generation of decentralized finance

  30. Discover CowSwap, the trusted decentralized exchange platform for seamless crypto trades in 2025. With low fees, high security, and fast transactions, CowSwap is a go-to solution for DeFi users worldwide

  31. Discover the future of decentralized finance with Woofi Finance, a cutting-edge platform for seamless crypto staking and yield farming. Maximize your returns with low fees and high rewards. Join the revolution in DeFi today!

  32. Discover CowSwap, the trusted decentralized exchange platform for seamless crypto trades in 2025. With low fees, high security, and fast transactions, CowSwap is a go-to solution for DeFi users worldwide

  33. ok365 says:

    Wow! This can be one particular of the most beneficial blogs We have ever arrive across on this subject. Basically Great. I am also a specialist in this topic therefore I can understand your effort.

  34. ?? ?? ?? says:

    Each mining cycle produces an ‘x’ number of cryptocoins and every four to five years, this pool gets difficult to mine and the cryptocoins generated become ‘x/2’.

  35. ??? ??? ??? says:

    International Information. The Canadian Press.

  36. In accordance with my research, after a foreclosures home is bought at a sale, it is common with the borrower to be able to still have a remaining unpaid debt on the personal loan. There are many financial institutions who try and have all rates and liens paid off by the subsequent buyer. Nevertheless, depending on particular programs, rules, and state regulations there may be some loans that aren’t easily resolved through the switch of financial loans. Therefore, the obligation still remains on the debtor that has acquired his or her property foreclosed on. Many thanks for sharing your notions on this blog site.

  37. ??? ?????? says:

    It then clipped the south edge of the Western Kentucky College campus, where the buildings had been in a roundabout way hit by tornadic winds, but debris was discovered speared into the exterior partitions of some constructions.

  38. RFID badges says:

    Virtually all of the things you state is astonishingly precise and that makes me ponder why I hadn’t looked at this in this light previously. Your article really did turn the light on for me personally as far as this specific topic goes. But at this time there is actually just one position I am not too cozy with so while I try to reconcile that with the main theme of the position, allow me observe just what all the rest of your readers have to say.Well done.

  39. ?? ???? says:

    Analysis agency Tesltye notes: “Australian households are in the midst of an Internet of Things (IoT) at home revolution”.

  40. Lovely just what I was looking for.Thanks to the author for taking his time on this one.

  41. ???? ?? ?? says:

    But earlier than you hire event Management Firm, it’s crucial to keep few points into consideration.

  42. Fausto Gron says:

    Looking for fast and secure cross-chain transactions? Check out Stargate Bridge today! ????

Leave a Reply

Your email address will not be published. Required fields are marked *