I was looking at a script used by a website and the code is packed, with no indentations or structure(In actuality every web-site I went to had this kind of code structure.). I was trying to learn jquery, so I thought I should look at other people codes using google dev tools. How to make this code easier to read ?
Asked
Active
Viewed 20 times
0
-
In Developer Tools Sources tab, click on the `{}` tool to reformat it. – Barmar May 14 '21 at 22:09
-
@DanO That code isn't obfuscated. It's just minified. – Barmar May 14 '21 at 22:10
-
But it still won't be understandable, because all the variable names have been removed. – Barmar May 14 '21 at 22:10
-
Don't try to learn from minified production code. Find examples in github. – Barmar May 14 '21 at 22:11
-
In PHPStorm Ctrl+Alt+(Shift)+L https://www.jetbrains.com/help/phpstorm/reformat-and-rearrange-code.html – sebastian_t May 14 '21 at 22:11
-
@Barmar Thank you for your suggestion. I will search github for better examples. – NEWHELL69 May 14 '21 at 22:14
-
@Barmar one of the utilities linked in that thread claims to try to substitute human-meaningful variable names for minified names. (I agree though, this is not the best way to learn how to use jQuery.) – Dan O May 14 '21 at 22:16
-
@DanO The explanation says that it does that by searching github for the code. Proprietary code is probably not in public repos. – Barmar May 14 '21 at 22:18
-
@DanO can you also give me suggestions on how I should learn JQuery. Is it same as Barmar, search through github examples ? – NEWHELL69 May 14 '21 at 22:19