01 / 05
An error comes out and it stops there
So far an error has been "something to fix when it comes out". But things can fail for reasons other than mistyping — data arriving from outside is a different shape from what you thought, an entry that should be there is not, and so on.
When an error happens, the program stops on that line. The lines written after it no longer run. In the example below, end never comes out.
const fruits = ["apple"];console.log("start");fruits.add("peach");console.log("end");Result
start TypeError: fruits.add is not a function