Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Froot75407yWait. So someone wrote in a full retard thing that wouldn't run in any language and it's JS's fault? 🤔
-
var something = someFunction; // will assign a reference to the function
var something = someFunction(); // will call the function and assign the returned value -
CptFox16167y@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.
-
Froot75407y@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.
-
CptFox16167y@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 -
Froot75407y@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 🤔
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
undefined
knockoutjs
javascript
wft js
im dumb