This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function student(fname, mname, lname){ | |
| this.fname = fname; | |
| this.mname = mname; | |
| this.lname = lname; | |
| this.getFullName = function (){ | |
| return this.fname + " " + this.mname + " " + this.lname; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function student(fname, lname){ | |
| this.fname = fname; | |
| this.lname = lname; | |
| this.getFullName = function (){ | |
| return this.fname + " " + this.lname | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SECONDS = 60; | |
| var MINUTES = 60; | |
| var HOURS = 24; | |
| var DAY = SECONDS * MINUTES * HOURS; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SoftwareDeveloper { | |
| constructor(firstName, lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| this.name = _getName(firstName, lastName); | |
| } | |
| _getName(firstName, lastName) { | |
| return `${firstName} ${lastName}`; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SoftwareDeveloper { | |
| constructor(firstName, lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| } | |
| getName() { | |
| return `${this.firstName} ${this.lastName}`; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div> | |
| <UserProfile | |
| user={{ firstName: 'Robin', lastName: 'Wieruch' }} | |
| /> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // bad | |
| function userProfile(user) { | |
| return ( | |
| <div> | |
| <span>First Name: {user.firstName}</span> | |
| <span>Last Name: {user.lastName}</span> | |
| </div> | |
| ); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SoftwareDeveloper { | |
| constructor(firstName, lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| } | |
| } | |
| var me = new SoftwareDeveloper('GP', 'LEE'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // bad | |
| function name(firstName, lastName) { | |
| return `${firstName} ${lastName}`; | |
| } | |
| // good | |
| function getName(firstName, lastName) { | |
| return `${firstName} ${lastName}`; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // bad | |
| var visible = true; | |
| // good | |
| var isVisible = true; | |
| // bad | |
| var equal = false; | |
| // good |