JSON Viewer

Why does this exist?

A fairly quick exercise in trees, recursion and svelte's self special element.

  • {
  • icecream :
    • [
    • 0 :
      • {
      • flavor : chocolate
      • recommendedWith :
        • {
        • flavor : vanilla
        • recommendedWith :
          • {
          • flavor : chocolate
          • }
        • }
      • }
    • 1 :
      • {
      • flavor : strawberry
      • recommendedWith :
        • {
        • flavor : chocolate
        • }
      • }
    • 2 :
      • {
      • flavor : mint
      • recommendedWith :
        • {
        • flavor : chocolate
        • }
      • }
    • ]
  • }

Conclusion

Svelte's self element makes recursion a breeze which is just a Svelte component calling itself.

© 2023-2024 TaylorH Dev, All rights reserved