Different JavaScript approaches