TL;DR
JavaScript has some really cool abilities that allow you to do amazing things with just a single line of code. Here are 30 useful ...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
If you put several commands in one line, separated by semicolons, it is not a one-liner
I ran uglify on my codebase and now my entire app is apparently a one-liner!
IKR xD
Couldn't agree with you more.
LOL! #1 a one-liner?? Bro, get serious.
IT is AI written, that's the problem. I agree with you though.
I would probably not generate UUIDs this way. Use a library. While I am not an expert in this area, I am pretty sure a bit more goes into a UUID than what you've shown.
Just look at the source for the UUID package on NPM, it is not as simple as random characters: github.com/uuidjs/uuid/tree/main/src
There is a better way with
crypto.randomUUID()
it has good support in modern browsers developer.mozilla.org/en-US/docs/W...Yes, the UUID library wraps this where it is available.
Uuid should be unique. This math random has a small chance of generating the same output more than one. :D
It’s frustrating to see so many articles listing stuff without adding any value. You don’t cover how these work for folks, and I’m not sure memorizing a list of snippets is as helpful.
The codes are AI written. Still cool though. The "Sure! .... " gives it away.
Um, what does that mean? I don't understand what you are saying…
And I don't know if "alert("Hello, world!"); is all that killer. That was the first JS code I ever ran I think.
Uh. Did not like my comment? How about challenging it and starting to discuss?
Why would someone do that? :D
crypto.randomUUID()
method it has pretty good support for modern browsers: developer.mozilla.org/en-US/docs/W..."...That’ll Make You Look Like a Pro" I'm afraid the contrary is true. If someone in my team would come up with some of those, I'd have them think hard about what it means to be a pro within a team...