Previously, when I needed to store a number of related variables, I\'d create a class.
function Item(id, speaker, country) {
this.id = id;
this.speak
I made a small library to define struct if you work with ES6 compatibility.
It is a JKT parser you may checkout the project repository here JKT Parser
For an example you may create your struct like this
const Person = jkt`
name: String
age: Number
`
const someVar = Person({ name: "Aditya", age: "26" })
someVar.name // print "Aditya"
someVar.age // print 26 (integer)
someVar.toJSON() // produce json object with defined schema