Created
June 10, 2015 23:37
-
-
Save ericpkatz/58b8a1d85a5fe3ac3d94 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/sifuvu
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| console.clear(); | |
| function Person(config){ | |
| this.firstName = config.firstName; | |
| this.lastName = config.lastName; | |
| this.middleInitial = config.middleInitial; | |
| } | |
| Person.prototype = { | |
| fullName: function(){ | |
| return this.firstName + " " + this.middleInitial + ". " + this.lastName; | |
| }, | |
| sayHi: function(){ | |
| console.log("Hello my name is " + this.fullName()); | |
| } | |
| }; | |
| var prof = new Person({ | |
| firstName: "Eric", | |
| lastName: "Katz", | |
| middleInitial: "P" | |
| }); | |
| prof.sayHi(); | |
| var owen = new Person({ | |
| firstName: "Owen", | |
| lastName: "Katz", | |
| middleInitial:"A" | |
| }); | |
| owen.sayHi(); | |
| console.log(owen.fullName == prof.fullName); | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">console.clear(); | |
| function Person(config){ | |
| this.firstName = config.firstName; | |
| this.lastName = config.lastName; | |
| this.middleInitial = config.middleInitial; | |
| } | |
| Person.prototype = { | |
| fullName: function(){ | |
| return this.firstName + " " + this.middleInitial + ". " + this.lastName; | |
| }, | |
| sayHi: function(){ | |
| console.log("Hello my name is " + this.fullName()); | |
| } | |
| }; | |
| var prof = new Person({ | |
| firstName: "Eric", | |
| lastName: "Katz", | |
| middleInitial: "P" | |
| }); | |
| prof.sayHi(); | |
| var owen = new Person({ | |
| firstName: "Owen", | |
| lastName: "Katz", | |
| middleInitial:"A" | |
| }); | |
| owen.sayHi(); | |
| console.log(owen.fullName == prof.fullName);</script></body> | |
| </html> |
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
| console.clear(); | |
| function Person(config){ | |
| this.firstName = config.firstName; | |
| this.lastName = config.lastName; | |
| this.middleInitial = config.middleInitial; | |
| } | |
| Person.prototype = { | |
| fullName: function(){ | |
| return this.firstName + " " + this.middleInitial + ". " + this.lastName; | |
| }, | |
| sayHi: function(){ | |
| console.log("Hello my name is " + this.fullName()); | |
| } | |
| }; | |
| var prof = new Person({ | |
| firstName: "Eric", | |
| lastName: "Katz", | |
| middleInitial: "P" | |
| }); | |
| prof.sayHi(); | |
| var owen = new Person({ | |
| firstName: "Owen", | |
| lastName: "Katz", | |
| middleInitial:"A" | |
| }); | |
| owen.sayHi(); | |
| console.log(owen.fullName == prof.fullName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment