Most NES games had a way of saving, except the earliest NES games.
Most of them had codes you'd type in that was a save point. Many had actual save states on the cartridge.
The earlier games got around not having a code by having a secret early on the game that was revealed later on in the game so you could skip all of the parts you previously played.