The following works and does what I need. However, is there a better way to reference "a" and "b" in "c:"?
<html>
<head>
<script type="text/javascript">
var bar;
function Foo() {}
Foo.prototype = {
a: 1,
b: 2,
c: function() {
return Foo.prototype.a + Foo.prototype.b;
}
}
bar = new Foo();
console.log('c is: ' + bar.c());
</script>
</head>
<body>
<button onclick="document.write('c is: ' + bar.c())">Try it</button>
</body>
</html>