Instead of this code:
let img = document.createElement("img");
img.src = "foo.png";
img.className = "bar";
img.id = "abc123";
I'd like to do something like this:
let img = document.createElement("img")
{
src = "foo.png";
className = "bar";
id = "abc123";
}
I know I could write a function or a constructor to do it, but just wondering if there is some sort of native support for that in TypeScript?