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
Search - "js arrow function"
-
New JS arrow functions:
⇶ (“the gun rack”) – executes three times
↝ (“wiggly boi”) – finds the least efficient solution possible
⟳ (“the self-monch”) – executes forever
⍆ (“🤷”) – adds random side effects
⍅ (“the total and complete s**t”) – undoes the only useful and expected part of its execution
Absolutely hilarious 😆
https://medium.com/@Heydon/...3 -
I don’t like to judge people based on what languages they like (because I like all of them). But I can’t deny the pattern anymore.
Smart people know and enjoy smart languages: Smalltalk, OCaml, Clojure, Lisp, Haskell, etc. They may use JavaScript or PHP to make money, but ask them to code in their smart language and they’ll be more efficient. Getting old, some of those people say “screw it” and find a Haskell job.
You, my friend, are not one of those people. You are VSCode-dwelling goblin who thinks lambda calculus has something to do with JS arrow function notation, is scared of reduce() and not even good at the single fucking language they know.
Insta coders and that mechanical keyboard collector dorks are not “superstars” you got to be like.11 -
I was just chatting with my dad. He used to be mostly a C# dev but changed jobs and is now doing mostly Java. He says he likes it better.... Because it doesn't have lambdas/anonymous functions.
Uh.... Java was the first and only language where you can define interface implementations in-line (aka a whole bunch of functions)...
And 1.8 supports lambdas for Interfaces that have a single function...
I bet he'll hate JS... Where functions are can be passed around like objects, ES6 now supports lambdas and await, async... and anonymous functions (apparently they're called arrow functions?)9 -
These are the rules that apply to all of my JS projects:
- 100% typescript, “any” is not allowed
- strict prettier with pre-commit hook
- no semicolons
- no braces around single argument of an arrow function
- tabs7 -
Please fucking tell me there's a better cleaner way to write this render() function?
The use of so many "in-line" code evaluations, arrow functions, (), {}, ...
Just spent like probably 30 minutes just trying to figure out what closes what...
And the author is inconsistent?
Sometimes he uses map( location => { return ... })
other times he uses setState((prevState) => ({ key: this.state.keyValue}))
And there's no note as to why... are they interchangeable, used in specific cases, does it matter????!!!!!!
Or is he just trying to demonstrate 1000 different ways you can say the same thing in JS?
!@#!#@!$#%#$!@#!@#!#$$%30 -
I hate the overuse of arrow function everywhere even for super long expression. that `function` should fit to them more comfortably .
writer of code should aware that it take three time more to read expiration with arrow function inside5 -
stop using arrow function everywhere!!!!!!!
what that is mean ?
fns.reduce( (prev, fn) => fn(prev), input)
Are this is `fns.reduce` with two parameters
Or arrow function that return `input` variable.
take your time to visual parsing this crap4