optimization - Can I expect this value to be cached by a JavaScript engine? -
inside function have lines
var deal_date = new date(deal.created), cur_date = new date(), num_days_passed = math.floor((cur_date - deal_date) / (1000*60*60*24));
and i'm wondering whether, since it's in function, value of computation 1000*60*60*24
cached javascript engine. because otherwise have rid of magic number defining constant
window.seconds_per_day = 1000*60*60*24;
and on time gets laborious create code, when 1000*60*60*24
in fact more descriptive reading code (unless they're idiot).
Comments
Post a Comment