Path methods javascript successufully