Im writing a small application i Angular2, and need a simple way to convert a list to a dict.
I have a list:
var list = ["foo", "bar"];
I want to convert the list to a dict like this:
var dict = {foo: "foo", bar: "bar"};
Whats the easiest way to do this using typescript, javascript, jQuery or Angular2?