Liliia Dokuchaeva’s Post

Got a minute for some JavaScript? 🍒 What does this code output? Answers 🔍 >>> - "Tom says meow" - TypeError: c.createKitten is not a function - "Kitty says meow" Why the TypeError? *createKitten* is a static method - it lives on the *Cat* constructor, not on instances. *c* is an instance, so it cannot access static methods. Only *Cat.createKitten()* works. #javascript #webdevelopment

  • text

I liked the "meow" example. It reminds me of David J. Malan in CS50. Really cool!

To view or add a comment, sign in

Explore content categories