Intersection Method In Javascript