Skip to content

Instantly share code, notes, and snippets.

View danielng01's full-sized avatar

Daniel Georgiev danielng01

View GitHub Profile
function export_towns(section_number) {
var section_number_to_export = section_number.toString();
console.log('exporting '+section_number_to_export);
console.log(sections[section_number_to_export]);
// Extract unique towns, then sort with "ГР." towns first, followed by "С."
var sections_towns_export = [];
sections_towns_export[section_number_to_export] =
[...new Set(Object.values(sections[section_number_to_export]).map(entry => entry.town))]
.sort((a, b) => {
//console.log('a',a);