DEV Community

Discussion on: Appending a Child to an SVG using Pure Javascript

Collapse
 
zerogiven profile image
CSoellinger

Oh and at the third line should be

Object.entries(attributes).map(a => element.setAttribute(a[0],a[1]));
(JS Version)

Object.entries(attributes).map(a => element.setAttribute(a[0],a[1] as string));
(TS Version)

Collapse
 
gavinsykes profile image
Gavin Sykes

My reply to your earlier comment applies here too!