some js utilities