So let's say that I have two arrays in JavaScript. The first one contains the titles
var titles = [ "welcome page", "how it works", "about us"]
And the second one contains the links to those pages
var links = [ "/home", "/howitworks", "/about"]
I want to create a json, with the keys "title" and "link" from those two arrays like following:
source:{
{
title:"welcome page",
link:"/home"
},
{
title:"how it works",
link:"/howitworks"
},
...
}
Does anyone know how to do that?