This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ymaps.ready(function () { | |
ymaps.geolocation.get({ provider: 'yandex' }).then(function(result) { | |
var data = result.geoObjects.get(0).properties.get('metaDataProperty').GeocoderMetaData; | |
var administrativeAreaName = data.AddressDetails.Country.AdministrativeArea.AdministrativeAreaName; // region | |
if ('SubAdministrativeArea' in data.AddressDetails.Country.AdministrativeArea) { | |
var localityName = data.AddressDetails.Country.AdministrativeArea.SubAdministrativeArea.Locality.LocalityName; // city | |
} else { | |
var localityName = data.AddressDetails.Country.AdministrativeArea.Locality.LocalityName; // city |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mandatory = () => { | |
throw new Error('Missing parameter!'); | |
} | |
foo = (bar = mandatory()) => { | |
return bar; | |
} |