How to get values listed in translations object?
I am trying to use Array destructuring to get object values.
Even while getting keys javascript won't return full key value such as getaQuote
instead it turns out just first letters g
.
Expected console result would be:
getaQuote : a : Get a Quote: Kostenloses Angebot : Richiedi un preventivo : Teklif Al
uploadFile : b : Upload File: Datei Upload : Datei Upload : Dosya Gönder
"use strict";
const translations = {
getaQuote: {
loc: "a",
en: "Get a Quote",
de: "Kostenloses Angebot",
it: "Richiedi un preventivo",
tr: "Teklif Al"
},
uploadFile: {
loc: "b",
en: "Upload File",
de: "Datei Upload",
it: "Datei Upload",
tr: "Dosya Gönder"
},
contacts: { loc: "c", en: "Contacts", de: "Kontakt", it: "Contatti" , tr: "İletişim"}
};
for (let [key, value] in translations ) {
let result = `${key}: ${value.loc} : ${value.en} : ${value.de} : ${value.it}: ${value.tr}`;
console.log(result);
}