This is probably a trivial question, but I'm trying to look for the most efficient way to do this.
I am given a string in this format "20130914" from a servlet and I need to create a javascript date object from it.
From what I know, date object accepts ISO format for strings so I need to append dashes in between my year,month and date like this "2013-09-14"
I could use .splice function to insert dashes in between the year,month and date but I feel like there has to be an easier solution for this trivial question. Or am I overthinking this?