I currently have the following arrays:
var keys = [ "color", "size" ];
var values = [ "blue", "medium" ];
My goal is to transform them into an object like this:
{ color: "blue", size: "medium" }
In Python, you can achieve this easily with dict(zip(keys,values))
. Is there a similar method in jQuery or vanilla JavaScript, or do I need to take the longer route?