Why Google Doesn't Optimize Date / Time Designs on Its First Javascript Page

In JavaScript, we can get a number representing the current date / time, for example:

var dt = new Date();
var e = dt.getTime();

A slightly shorter way to do this could be:

var f = (new Date()).getTime();

The most compact way to do this is reflected in the following code:

var g = +new Date;  //11 bytes shorter

(See them here: http://jsfiddle.net/es4XW/2/ )

Now, when you look at the source code of the Google homepage, you will find the second convention used 11 times. Thus, it seems that every time Google could save 11 bytes - a total of 121 bytes.

Compression and caching will play a role in mitigating this, but of course it would be helpful for Google to make this simple switch.

Amazons, ( ).

Google ? 121 , , , .

+5
1

, , , . , 2 , - , - (, Rhino, Node).

, :

var now = function() {
    return (new Date().getTime());
}

, , , , .

+4

All Articles