4 ms·
I think your example should instead be: someFunction.toString().charAt(10) == 'a' so you're getting the function's string representation, not its return v
by emptysea 6y ago
I think your example should instead be:
someFunction.toString().charAt(10) == 'a'
so you're getting the function's string representation, not its return value
Also I've never even considered that minifiers can break your code.
To be safe it seems you either need to run minification during test & dev or setup some linting to ban features that could break during minification.
- evmar 6y agoYou are totally right, thanks for catching my mistake. My blog post linked above goes more into the consequences -- ideally you'd formally define what the allowable language subset is.