If
you do not assign any value to a property, then the value is undefined.
HelloWorld.js
class Employee{ constructor(firstName, lastName){ this.firstName = firstName; this.lastName = lastName; } } var emp = new Employee(); console.log(emp.firstName + " : " + emp.lastName);
Output
undefined
: undefined
No comments:
Post a Comment