function show tag return function txt document write tag txt tag var h

1
2
3
4
5
6
7
function show (tag) {
return function(txt) {
document.write('<' + tag + '>' + txt + '</' + tag + '>');
}
}
var h1 = show('H1');
h1('Hi');