Js minify

+1 Diego Mariani · January 19, 2015
Hi guys I'm trying to realize my own JS minify routine in Java or in javascript, it doesn't matter.The issue is that I cannot found any specification about minify algorithm. I have only to delete all spaces and new line returns ? Thanks

Post a Reply

Replies

Oldest  Newest  Rating
+1 Jay Tauron · January 20, 2015
for if else statements use ternary operator test?true:false;
use single letter variables
use []._ instead of undefined
if (f()) g(); can be shortened to f()&&g()
!0 and !1 can be true and false, respectively
x=x||'default' for default values in functions
return values straight away if they can be
declare vars in function params if no args passed
  • 1

Javascript

106,999 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators