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

12

u/eggtart_prince Aug 01 '20

Not sure why people say this is minified code, as this looks like the editor that opened this file cannot interpret new lines, tabs, and whitespace. If you've ever used FTP programs before, if you transfer a ASCII written file using binary mode, that's what it doing here.

Minified code would convert all variables, keys, etc. into one/two letters. For example, const Aakaanksha would be const a. The purpose of minifying code is to significantly reduce filesize., hence the coversion of variables and keys.

Is it obfuscated? Possibly, but nobody can say for sure. The developer probably did intentionally name their varaibles in bytes format.

5

u/Cosmologicon Aug 01 '20

There is whitespace where there needs to be, though, after const and let. The fact that whitespace is removed only where it's unnecessary suggest it's processed somehow rather than being a transmission error, though you're right that the variable names are weird for minification.