Array
// Definition
let language = new Array();
language["DE"] = "Guten Morgen";
language["EN"] = "Good morning";
language["IT"] = "Buongiorno";
language["FR"] = "Bonjour";
// Guten Morgen User!
console.log(language["DE"] + " " + "User!");
// ["DE","EN","IT","FR"]
var aKeys = Object.keys(language);
console.log(JSON.stringify(aKeys));
// 12
console.log(language["DE"].length);
// 0
console.log(language.length);
Object
// Definition
let language = new Object();
language["DE"] = "Guten Morgen";
language["EN"] = "Good morning";
language["IT"] = "Buongiorno";
language["FR"] = "Bonjour";
// Guten Morgen User!
console.log(language["DE"] + " " + "User!");
// ["DE","EN","IT","FR"]
var aKeys = Object.keys(language);
console.log(JSON.stringify(aKeys));
// 12
console.log(language["DE"].length);
// undefined
console.log(language.length);