javascript trick functions