UPDATE: okaaay, looks like I screwed ups. I forgot the equal sign.
fruit.goodness = function ()
I have spent many hours trying to figure this out. I am sure all the experts on this forum can catch the problem within seconds. Any help would be greatly appreciated. Thanks.
Isn’t the output supposed to be 10? I did not use any of the properties in the fruit object, but it should still work.
<html>
<body>
<script type="text/javascript">
var fruit = { e:1, f:4, g:6};
fruit.goodness function () {
var x = 9
return x+1;
};
document.write(fruit.goodness());
</script>
</body>
</html>