Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Is there any fundemental differnces between these two constructor functions?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #39085
    justinwhall
    Participant

    function Person(first, last) {
    this.firstName = first;
    this.lastName = last;
    this.full = function() {
    return this.firstName + ' ' + this.lastName;
    }
    }

    function Person(first, last) {
    return{
    firstName : first,
    lastName : last,
    full : function() {
    return this.firstName + ' ' + this.lastName;
    }
    }
    }
Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.