I need to create a script element and append the google map function there. I'm wondering: can I use a variable in my function via the append.
var center = {lat: -34.397, lng: 150.644};
document.createElement("script").append(
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: center,
zoom: 8
});
}
);