javascript trimmings