DEV Community

Discussion on: Operator Overloading in JavaScript, yes you can!

 
drsensor profile image
૮༼⚆︿⚆༽つ

At least it doesn't do any string operation. Another approach is to use either tagged-template-literal or JSX but it hit perf quite bad since it need to translate math ops that is in string into the real one (e.g "+" -> +). This is a big no for gamedev. The solution is to use babel-macro but it slow down the devserver since it depend on babel. I wish esbuild support macro or there is a go esbuild-plugin for this.
Sorry for the rambling. Best luck to us 😃