I have to functions, one is within an external js file named "london.js" and one is within a HTML script.
I wish to take a value from the external file and insert it into my HTML script function.
function initMap(cityLatLng) {
map = new google.maps.Map(document.getElementById('map'), {
zoom: 12,
center: ldn,
}
function loadLondon() {
var ldn = {lat: 51.5, lng: -0.1}
}
I am not sure how to pass values through functions, I have tried putting the variable outside the function but it didn't work. I wish to make use of the var ldn in initMap.
Thanks in advance.