js understanding the weird parts