javascript understanding the weird parts