以前は、関連する変数を多数格納する必要がある場合、クラスを作成していました。
function Item(id, speaker, country) {
this.id = id;
this.speaker = speaker;
this.country = country;
}
var myItems = [new Item(1, 'john', 'au'), new Item(2, 'mary', 'us')];
しかし、これが良い習慣であるかどうかは疑問です。JavaScript で構造体をシミュレートする他のより良い方法はありますか?