Javascript Code Questions




What is the value of foo?

var foo = 10 + '20';




What value is returned from this statement?

"i'm a lasagna hog".split("").reverse().join("");




What is the outcome of the two alerts below?

var foo = "Hello";
(function() {
  var bar = " World";
  alert(foo + bar);
})();
alert(foo + bar);