learn something off by heart

naučiti nešto napamet

(To learn something in such a way that you can say it from memory.)

I learnt all the vocabulary off by heart.