If you want to get some structure to your Javascript code and make it work like you are using a fully fledged programming language such as C# then consider Typescript. Microsoft’s new SPFx fully supports it so you are all good if you wish to use it.
“TypeScript starts from the same syntax and semantics that millions of JavaScript developers know today. Use existing JavaScript code, incorporate popular JavaScript libraries, and call TypeScript code from JavaScript.
TypeScript compiles to clean, simple JavaScript code which runs on any browser, in Node.js, or in any JavaScript engine that supports ECMAScript 3 (or newer).”
Leave a Comment