comapre js delegate