Javascript "object or function?"

יום רביעי, יולי 20, 2011

Hi all,See below example, how to make your javascript code sexy.If you call --> getTimeStamp as variable, return object of the Date.now, but if you call --> getTimeStamp() as function, return a timestamp value. var getTimeStamp = Date.now || function () { return +(new Date).getTime(); }; BestBasil
תגובה אחת