I declare Homebrew as a dependency for cask and referred to homebrew by this.homebrew[0]. Is anything like this possible with JavaScript?
var data = {
homebrew: [
{
title: "Homebrew",
dependencies: [],
install: function() {
console.log('homebrew')
}
},
{
title: "Cask",
dependencies: [
this.homebrew[0]
],
install: function() {
console.log('cask')
}
}
]
}
datashould be an object in your case. Besides, howdependenciesis used in further logic ?dependenciesshould image the whole object titledhomebrew