Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The expression `typeof x === 'some string'` is treated as a peephole optimization by JavaScript runtimes and optimized as a simple type test without an explicit string comparison. Refactoring the `typeof x` part into a variable cause this to be deoptimized: the type information is lost and we end up doing actual string comparison operations at runtime.
- Loading branch information