Test JS

What will this code output in Console:
>function f() {
   bar = 2;
 }
>f()
>bar
Undefined
2
Reference error: bar is not defined
{"name":"Test JS", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"What will this code output in Console: >function f() {    bar = 2;  }>f()>bar","img":"https://www.quiz-maker.com/3012/images/ogquiz.png"}
Powered by: Quiz Maker