@MetaWhy/

AdmiredFoolhardyNurseshark

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var Person = function(totalName) {
 //parse the full name to first and last
  var splitIt = totalName.toString().split(' ');
  var first = splitIt[0];
  var last = splitIt[1];
  //set full name
  function getFullName(totalName){
    this.firstAndLast = firstAndLast;
    return firstAndLast;
  }
  
  
  function getFirstName(totalName){
    this.firstName = first;
    return first
  }
  
  function getLastName(totalName){
    this.lastName = last;
    return last;
  }
  function setFullName(){
     getFullName(firstAndLast);
  }
  function setFirstName(){
     getFirstName();
  }
  function setLastName(){
     getLastName();
  }
};
var bob = new Person('Meta Ross');
bob.getFullName();
Native Browser JavaScript