Skip to content

Instantly share code, notes, and snippets.

@spikesagal
Created October 1, 2015 17:01

Revisions

  1. spikesagal created this gist Oct 1, 2015.
    23 changes: 23 additions & 0 deletions run.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    'use strict';
    class Person {
    constructor(arg = {
    firstName: 'John',
    lastName: 'Doe'
    }) {
    ({
    firstName: this.firstName = '<FIRSTNAME_UNKNOWN>',
    lastName: this.lastName = '<LASTNAME_UNKNOWN>'
    } = arg);
    }
    printName() {
    console.log(this.lastName, ',', this.firstName);
    }
    }

    var person;
    person = new Person({
    firstName: 'Alex'
    })
    person.printName();
    person = new Person;
    person.printName();