Is there a way to make this JavaScript code more concise and less repetitive?

This page summarizes the projects mentioned and recommended in the original post on /r/learnprogramming

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • htm

    Hyperscript Tagged Markup: JSX alternative using standard tagged templates, with compiler support.

  • Frameworks definitely help solve this problem in part. But you don't need to go that far just for something simple like this. For example you could use htm plus vhtml to get a no-build tools way to write declarative HTML markup that is translated into a plain HTML string. Or for just a few more kb, you can use htm + preact to get all of the power of React for about 13kb, again with no build tools or setup.

  • vhtml

    Render JSX/Hyperscript to HTML strings, without VDOM 🌈

  • Frameworks definitely help solve this problem in part. But you don't need to go that far just for something simple like this. For example you could use htm plus vhtml to get a no-build tools way to write declarative HTML markup that is translated into a plain HTML string. Or for just a few more kb, you can use htm + preact to get all of the power of React for about 13kb, again with no build tools or setup.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts