I have this string
\'john smith~123 Street~Apt 4~New York~NY~12345\'
Using JavaScript, what is the fastest way to parse this into
This isn't as good as the destructuring answer, but seeing as this question was asked 12 years ago, I decided to give it an answer that also would have worked 12 years ago.
function Record(s) {
var keys = ["name", "address", "address2", "city", "state", "zip"], values = s.split("~"), i
for (i = 0; i