7

Wtf JS.
It take two days that root of the problem is two char - "()".
Someone write isManageExp instead isManageExp()

maybe im too dumb about this fuckin js thing.

I go around all file to make sure the ouput is correct.
Damn js, damn damn

Comments
  • 5
    Wait. So someone wrote in a full retard thing that wouldn't run in any language and it's JS's fault? 🤔
  • 5
    var something = someFunction; // will assign a reference to the function

    var something = someFunction(); // will call the function and assign the returned value
  • 3
    @Froot to be fair, pretty much any other language would have sounded the alarm. I don't do much JS, but shouldn't linters look for the use of functions without parentheses? I know there are valid use cases for this, but just a quickly dismissable warning seems like it would have solved the problem.
  • 2
    @CptFox Some linters might do that. ESLint and Flow.js are your best bets here I think. But assigning a function reference is a perfectly valid operation that happens all the time. I don't think you can put an alarm on that without annoying a bunch of people.
  • 0
    @Froot Yeah I guess so, but one specific assignments are rarer. For example, in
    let a = () =>{}; let b = a;
    I don't see much point in reassigning the function other than to cause confusion, so maybe warnings could be put on reassignment only
  • 0
    @CptFox Mmmm perhaps. There are cases where your function gets a callback and you assign it somewhere for later use. This would probably also trigger on those 🤔
  • 2
    Try TypeScript.
Add Comment