Skip to content

Instantly share code, notes, and snippets.

@erikroyall
Last active August 29, 2015 14:07
Show Gist options
  • Save erikroyall/96a07e0750ec1bf9a1ee to your computer and use it in GitHub Desktop.
Save erikroyall/96a07e0750ec1bf9a1ee to your computer and use it in GitHub Desktop.
JavaScript and Semicolons
function Person (name, age) {
this.name = name;
this.age = age;
}
Person.prototype = {
getName: function () {
return this.name;
},
getAge: function () {
return this.age;
}
}
var me = new Person("Erik Royall", 15);
var string = "";
string += (me.getName());
string += (" is ");
string += (me.getAge());
string += (" years old.");
console.log(string);
function Person (name, age) {
this.name = name
this.age = age
}
Person.prototype = {
getName: function () {
return this.name
},
getAge: function () {
return this.age
}
}
var me = new Person("Erik Royall", 15)
var string = ""
string += (me.getName())
string += (" is ")
string += (me.getAge())
string += (" years old.")
console.log(string)
function Person (name, age) {;;
;;this.name = name;;;;;;;;;;;;;
;;this.age = age;;;;;;;;;;;;;;;
};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Person.prototype = {/*;;;;;;;;;
*/getName: function () {;;;;;;;
;;;;return this.name;;;;;;;;;;;
;;},/*;;;;;;;;;;;;;;;;;;;;;;;;;
*/getAge: function () {;;;;;;;;
;;;;return this.age;;;;;;;;;;;;
;;}//;;;;;;;;;;;;;;;;;;;;;;;;;;
};;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
var me = new Person(//;;;;;;;;;
"Erik Royall",//;;;;;;;;;;;;;;;
15);;;;;;;;;;;;;;;;;;;;;;;;;;;;
var string = "";;;;;;;;;;;;;;;;
string += (me.getName());;;;;;;
string += (" is ");;;;;;;;;;;;;
string += (me.getAge());;;;;;;;
string += (" years old.");;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
console.log(string);;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment