15

When you think the code from companies like Google and Facebook is flawless, but then you look at the source code of Parse 1.5.0 and find an if statement with the condition 'browser' === 'browser'

Comments
  • 0
    TBH it can be something like prosess.env.NODE_ENV === 'browser' got transpiled. Babel or webpack does that.
  • 0
    @yjcxy12 to be honest I didn't think of that possibility. It doesn't seem to have been compiled by webpack or transpiled by babel. Maybe some preprocessor, but there are other places in the code where node or browser checks happen via very different means.
Add Comment