document write select for var 20 console log document write option opt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
document.write('<select>');
for (var i = 1; i <= 20; i++) {
console.log(i);
document.write('<option>'+ i +'</option>');
};
document.write('</select>')
(Листинг 2.4)
var log = function(a) {
console.log(a);
}
log('hi');