Created
July 8, 2020 06:09
-
-
Save gpDA/d863cb66b747df37fa2081aeb6342d5f to your computer and use it in GitHub Desktop.
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 Car( model, year, miles ) { | |
| this.model = model; | |
| this.year = year; | |
| this.miles = miles; | |
| this.toString = function () { | |
| return this.model + " has done " + this.miles + " miles"; | |
| }; | |
| } | |
| // USAGE : | |
| var civic = new Car("Honda Civic", 2009, 20000 ); | |
| console.log(civi.toString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment