Some code for a basic javascript assignment.

Chessboard, anyone?


var chessboard = function(x,y){
for(var i = 1; i <= y; i++){ if (i%2 ==0){ console.log(Array(x+1).join("# ")); }else{ console.log(Array(x+1).join(" #")); } } } function stack(number){ for(var i = 1; i <= number; i++){ console.log(Array(i+1).join("#")); } } for(var i = 1; i < 10; i++){ if (i % 15 == 0){ console.log("fizzbuzz"); }else if(i % 3 ==0){ console.log("fizz"); }else if(i % 5==0){ console.log("buzz"); }else{ console.log(i); } } [/javascript]