Coder & software architect in Brooklyn, NY.
var gary = {
name: 'Gary',
do: function() {
throw 'stones';
}
};
var house {
residents: [gary],
material: 'glass'
};
try {
house.residents.forEach(function(resident) {
resident.do();
});
} catch (thrown) {
if (thrown === 'stones' & house.material === 'glass') {
alert('Dammit Gary!');
}
}