answers to hw and hopely to project

Answer#1

var print = "#";
for(var i=0; i<7; i++){

	console.log(print);
	print += "#";	
}

Answer#2

for(var i=0; i<100; i++){

	if((i+1)%3==0 || (i+1)%5==0){
		console.log("FizzBuzz");
	} else {
	console.log(i+1);
	}
}

Answer#3

var size = 8;
var print1 = "#";
var print2 = " ";
var printFinal1 = "";
var printFinal2 = "";
for(var i=1; i<size+1; i++){
	if (i%2==1){
		printFinal1+=print1;
		printFinal2+=print2;
	}
	else{
		printFinal1+=print2;
		printFinal2+=print1;
	}
}

for(var i=0; i<printFinal.length; i++){
	if(i%2==0){
		console.log(printFinal1);
	} else {
		console.log(printFinal2);
	}
}

Yeah hay.

As for the project that

Create a single web page experience that, upon user input, responds with data from at least 2 web apis. (1) a user needs to “trigger” an event, (2) data needs to be requested via AJAX from two APIs, (3) and the page should update appropriately.

I’m not sure yet… stiill tuning!

Leave a Comment.