I have a set of objects in C # that are used to generate JavaScript. There is a web interface in which you select a ton of options, this creates a large object in C #. The object is then converted to JavaScript using a set of user-defined functions. This JavaScript is the core of our application, it runs on the server side using the V8 engine.
Currently, JavaScript is actually generated on the client, and this is a huge mess, impossible to verify, difficult to maintain, etc. It uses a ton for loops and string concatenation to generate JS. I would like to move this generation to C # and make it more verifiable. What are some good methods to create this JS? Is string concatenation an even better option?
Shawn source share