My approach so far has been the following:
try {
var obj = {"name":"n","name":"v"};
console.log(obj); // outputs { name: 'v' }
} catch (e) {
console.log(e); // no exceptions printed
}
My goal is to detect duplicate keys within a large static Javascript object using conventional tools.