Cloning a JavaScript Object Using jQuery

I was recently using Keith Wood’s calendar plugin and kept running into an issue when trying to copy a date object and add days to it. When I would copy the object, I was actually just creating a reference to the original… Not what I wanted.

Found the answer was to clone the object, and John Resig had the answer via jQuery’s $.extend() method. It’s awesome when your fav lib has the method you need so writing one from scratch isn’t necessary. Check it out: Continue reading “Cloning a JavaScript Object Using jQuery”