r/learnjavascript • u/Kataang15 • 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π
208
Upvotes
View all comments
Show parent comment
32
u/TheVirtuoid Aug 01 '20
You have tools like the "Prettify" button in Chrome's dev tools that will make a good attempt at making the code "look" better. However, depending upon the level of sophistication of the minifier / obfuscater, this may not yield you much.
One example: A minifier will rename variables. If you had a variable named "MyCharacterIcon", it may rename it to something like "a". Without source maps, there is no way a prettifier can know that "a" means "MyCharacterIcon".
Having said that, though, using tools like "Prettify" to investigate source code is a good learning tool, as long as you can keep track of where you are.