better javascript syntax