我想打印鲍勃史密斯和他的年龄,我该怎么做?该示例是 codecademy 上面向对象系列的一部分,任何帮助将不胜感激。
function Person(name, age) {
this.name = name;
this.age = age;
};
// Let's make bob again, using our constructor
var bob = new Person("Bob Smith", 30);
var susan = new Person("Susan Jordan", 35);
// make your own class here
console.log(this.name);