Skip to content

Instantly share code, notes, and snippets.

@chomwitt
Created March 15, 2013 07:25
Show Gist options
  • Save chomwitt/5168080 to your computer and use it in GitHub Desktop.
Save chomwitt/5168080 to your computer and use it in GitHub Desktop.
function set_full_name(new_name) {
var names ;
names = new_name.trim().split(/\s+/) ;
this.first_name = names[⁣"0"] || "" ;
this.last_name = names["1"] || "" ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment