r/learnjavascript • • Aug 01 '20

Is this common Javascript? because I've just started learning JS and Web development and this Javascript syntax looks quite scary. Maybe it's just written messy, if it is just tell meπŸ˜…

Post image
208 Upvotes

105 comments sorted by

View all comments

170

u/LucVolders Aug 01 '20

To make things clear. You never write javascript this way. You write it in a normal style with commands on new lines all the time. Then when the code is finished and tested thoroughly you minify it. Then it looks like this. Minifying speeds processing up. You keep the original code for updates/changes/bugfixes.

9

u/densch92 Aug 01 '20

is there an actual way to "maxify" things too?
sure comments are lost, that's clear.

but there must be certain rules how stuff is put into a minified form. so shouldnt the other way be possible too?

7

u/JamesWilsonCodes Aug 01 '20

If the process includes a source map, browser devtools can see the original code :)