I was wondering - what\'s the difference between JavaScript objects, classes and functions? Am I right in thinking that classes and functions are types of objects?
A
There are classes in javascript they just aren't used on older browsers.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
It has constructors, extentions, and the like.
class Cat {
constructor(name) {
this.name = name;
}
speak() {
console.log(this.name + ' makes a noise.');
}
}
class Lion extends Cat {
speak() {
super.speak();
console.log(this.name + ' roars.');
}
}