Lazy Evaluation

Introduction to lazy evaluation

Lazy evaluation is when we write a series of instructions that won’t be executed right now. Instead, they will wait for a trigger that will tell them the right moment to run. It’s like if a friend of yours is cooking a roast turkey for Christmas and gives you an instruction to remove it from the oven. You can’t take it out right away when they tell you; that would be too soon. Instead, you need to wait for that little red thing in the turkey to pop up; that’s the right moment.

Get hands-on with 1400+ tech skills courses.