You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// What makes the person class is the new way to create a constructor function. You define the constructor inside the class instead of inside the function.
@@ -25,13 +26,67 @@ class Person {
25
26
setName(fullName){
26
27
constnames=fullName.split(" ");// This .split allows us to split a string and make an array. We're currently splitting on a space. This would create just Andrew
27
28
this.firstName=names[0];
28
-
this.lastName=[1];
29
+
this.lastName=names[1];
29
30
}
30
31
}
32
+
33
+
// The class Employee extends from Peron meaning we it has the same behaviour as person. This means we don't have to duplicate code.
0 commit comments