The basic purpose of an emergency fund as the name implies is to be available for use during unforeseen circumstances to avoid going into debt. All debt is not necessarily bad.
In fact debt can be used strategically to accelerate Financial Freedom Countdown. However, we need to ensure that lack of planning for an emergency does not cause us to spiral into debt.