John Lekberg


[ JUNTO | Current Practice | Old Practice | Log ]


JUNTO

JUNTO is a club for cool kids.

Oscar runs next meeting: 2019-11-05, 6pm ET (5pm CT).


Current Practice Problem

Eloquent Javascript

Chapter 2 exercises:

Solution - John

Looping a Triangle:

for (let n = 1; n <= 7; n++) {
	console.log("#".repeat(n));
}

FizzBuzz:

const fizz = (n) => n % 3 ? "" : "Fizz";
const buzz = (n) => n % 5 ? "" : "Buzz";
for (let n = 1; n <= 100; n++) {
	console.log((fizz(n) + buzz(n)) || n); 
}

Chessboard:

const size = 8;
for (let r = 0; r < size; r++) {
	let row = "";
	for (let c = 0; c < size; c++) {
		row += " #"[(r + c) % 2];
	}
	console.log(row);
}

Old Practice Problems


Log

A log of past information.

Marketwatch Games