Ask HN: How to inject code within a js so that it cannot be auto detected
My approach was to create a random var (x) which would have the code (a) split and concatenated in random locations within (b)
For example:
Var x="var code=fu";{random piece of (b)};x+="nction(";{random piece of (b)};x+="){}";{random piece of (b)};eval(x);{random piece of (b)}
1. Would you approach this problem differently? 2. How would you detect for root-level code within (b) - aka random locations outside loops or functions