10 JavaScript Features You Need To Use
HTML-код
- Опубликовано: 4 окт 2024
- Please note, this is satire. If you want real JavaScript tips then check out someone like @Fireship.
I hope you enjoyed :D
If you want to see more consider subscribing. - Развлечения
Javascript: the only language outside of INTERCAL that does whatever it feels like no matter what you typed.
How to unoptimize you js code:
1) you can't
10) javascript is already pure garbage
2) this
3) sequence
4) was
5) ordered
6) by
7) javascript
8) (lol, string orders, instead of int order
9) goes brrrrr)
const COLLATOR = new Intl.Collator(‘en’, { numeric: true, sensitivity: ‘base’ });
arr.sort((a, b) => COLLATOR.compare(a, b));
Enjoy.
@@jerichaux9219 thats a nightmare
@@jerichaux9219
let mut a = [3, 10, 17, 0, 1, 5];
a.sort_unstable();
wow, isn't using an actually not retarded language pleasant
@@jerichaux9219 ...or
let a = [17, 55, 19, 22, 10, 11, 1];
a.sort_unstable();
When I was in my teens, I wanted to work with programming. Then I learned about Javascript.
Then yo uare lucky you haven't learned about c++. Thats a real life changer. Made me question my career.
Just changed all my variables to racial slurs, my job has never been more secure!
Thank you! 🙏
Js is really crazy.often you can cause an infinite loop on the server by simply replacing a array in a json with object with a length prop.
{length:"Infinity"}
And of course it converts the string to Infinity.
Now I have to test this
@@Sirfreelancealot yeah js converts "Infinity" in Infinity when comparing it with a number
console.log(100
@@Sirfreelancealot it works if the server uses a simple for loop to iterate over the string
const str= {length:"Infinity}
for(let i=0;i
"""often"""
Dude you literally made it purposefully like that. It never happens and quite literally will never happen in reality.
@@twothreeoneoneseventwoonefour5 you dont know how many devs just iterate over not sanitised input.in one case i replaced a array with this object and it lagged the server (of a friend) because the server was stuck in a for loop periodically awaiting fetch() requests.Remember you just need to find one api that is vulnerable.
My favorite fact about JS is that there is a legacy DOM object that's specifically made falsy, for some ungodly reason. There are no other objects like this.
typeof document.all === "undefined" is true, but document.all !== undefined is also true
What about document.all !=== undefined ?
@@widmo206 Uncaught SyntaxError: Unexpected token '='
5:31 If you think E-Mail validation is that simple, might I recommend Dylan Beattie's talk "Email vs Capilalism, or, Why We Can't Have Nice Things"
Loved the eval() bit haha
this guy has TALENT
The funniest (un)optimization is reccomending people to use axios for json parsing
Wait what's wrong with axios?
Better than raw dogging fetch at least
@@Sirfreelancealot Axios solved the problem of XMLHttpRequest having an ugly API and not being promise-based.
With fetch being standard and well supported there's no real reason to use axios anymore.
You're adding kilobytes to your bundle just to have a marginally cleaner, non-standard API during development.
It's like people still pulling in jQuery because they prefer $ over querySelector
Fair enough. It's what I've been using for years and never realized people switched.
Good to know :)
Axios 1.0 still doesn't have a migration guide.
@@Sirfreelancealot axios is pure shit, fetch is much better
HUNGARY MENTIONED!
npm package is real now
Legend
how can you be unemployed with all this knowledge?
I quit to pursue my lifelong passion.
Writing code and not getting paid for it.
@@Sirfreelancealot how can you quit if it's a lifelong?
no no, he's unemployed _because_ of all this knowledge
@@boltyk1He quit his job to pursue his lifelong passion
the actual regex for email address verification is much, much worse.
can confirm
Ez meglepett :O
you're telling me this whole video is a lie?
xD
Pretty interesting that people would rather shit on javascript instead of learning it
I use it professionally, shitting on it is just a coping mechanism at this point.
pretty interesting how most javascript devs would rather sit in an increasingly broken flaming mess than do something about it / switch languages
@@itsentdev keep telling yourself that
@@EdwinMartin i'm not 'telling myself' that. did leftpad teach you anything about npm?
well, ignoring npm, javascript itself.
// interesting decision to make null equal zero like C...
if (0 >= null && 0
first
second
the language itself is not even the problem, in fact it’s pretty great, however then there’s the web as a platform and the node ecosystem, so I guess it does in fact suck horribly after all, don’t ever use it if you value your sanity, especially don’t get a job in webdev (for all our sakes)
the language itself is a part of the problem