Learn

Whereas include mixes a module’s methods in at the instance level (allowing instances of a particular class to use the methods), the extend keyword mixes a module’s methods at the class level. This means that class itself can use the methods, as opposed to instances of the class.

Instructions

Check out the code in the editor. We’ve extended TheHereAnd with ThePresent, allowing it to use the now method. Click Run to see the effect!

Folder Icon

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Already have an account?