Skip to content

Instantly share code, notes, and snippets.

@notsobad
Created March 9, 2012 08:24
Show Gist options
  • Select an option

  • Save notsobad/2005636 to your computer and use it in GitHub Desktop.

Select an option

Save notsobad/2005636 to your computer and use it in GitHub Desktop.
My js utils
var arrays_equal = function(a,b) { return a && b ? !(a<b || b<a) : false; }
//var log = (window.console && console.log) || function(){};
var log=function(){ window.console && console.log && console.log.apply(console, arguments) }
var n_day_ago= function(n){
var d = new Date();
d.setDate(d.getDate() - n);
d.setHours(0);
d.setMinutes(0);
d.setSeconds(0);
d.setMilliseconds(0);
return d;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment