Aptitude | JavaScript Course Quiz 3 | Question 5

Last Updated :
Discuss
Comments
What will be the output of the following code? JavaScript
<script>
let bar  = 1;
foo = {};
foo: {
     bar : 2;
     baz : ++bar;
};
document.write(foo.baz + foo.bar + bar);
</script>
NaN
5
4
1
Share your thoughts in the comments