[IMP]planner:improve code in js.