Skip to content

Instantly share code, notes, and snippets.

View JoeShep's full-sized avatar

Joe Shepherd JoeShep

  • Nashville Software School
  • Nashville
View GitHub Profile
@seanspradlin
seanspradlin / properties.js
Last active November 5, 2016 19:30
Object properties tutorial
function Person(firstName, lastName, age, ssn) {
// Declaring this way by default will make your property
// readable, writable, and enumerable
this.firstName = firstName;
this.lastName = lastName;
// Let's make a getter-only method that returns the
// two values as a whole name
Object.defineProperty(this, 'fullName', {
get: function() {