Skip to content

Instantly share code, notes, and snippets.

@tleen
Created August 21, 2013 20:00
Show Gist options
  • Save tleen/6299431 to your computer and use it in GitHub Desktop.
Save tleen/6299431 to your computer and use it in GitHub Desktop.
Javascript array of state names
['Alabama','Alaska','American Samoa','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','District of Columbia','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Marshall Islands','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York','North Carolina','North Dakota','Northern Mariana Islands','Ohio','Oklahoma','Oregon','Palau','Pennsylvania','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virgin Island','Virginia','Washington','West Virginia','Wisconsin','Wyoming']
@mergemaven11
Copy link

Thank you!

@hotcoffeehero
Copy link

Cheers.

@lawrencecchen
Copy link

Love you <3

@samends
Copy link

samends commented Jan 13, 2021

You are a hero ❤

@codenamezjames
Copy link

Legend!

@treetrunkz
Copy link

Thanks a bunch!

here is the PHP array

function getState() { $state = array('Alabama','Alaska','American Samoa','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','District of Columbia','Federated States of Micronesia','Florida','Georgia','Guam','Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Marshall Islands','Maryland','Massachusetts','Michigan','Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York','North Carolina','North Dakota','Northern Mariana Islands','Ohio','Oklahoma','Oregon','Palau','Pennsylvania','Puerto Rico','Rhode Island','South Carolina','South Dakota','Tennessee','Texas','Utah','Vermont','Virgin Island','Virginia','Washington','West Virginia','Wisconsin','Wyoming'); }

@ajiva84
Copy link

ajiva84 commented Feb 15, 2021

Thanks

@tmchedlishvili
Copy link

Anyone who wants different format of US states/abbreviations: https://usastatescode.com/state-array-json

@Joshua-Hager
Copy link

Thanks!

@Dylancouzon
Copy link

Thanks !

@oguzhancvdr
Copy link

Thank you!

@aaronl647
Copy link

Thanks!!

@DannyLuo-zp
Copy link

Thanks

@vmaharsh
Copy link

Thank you

@c27cochran
Copy link

c27cochran commented Oct 21, 2021

Thank you for the time saver, but these aren't the US states. There are only 50 states. This is a list of territories.

@hotcoffeehero
Copy link

slightly formatted and without territories

const stateNames = [
  'Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut',
  'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas',
  'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 
  'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 
  'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon',
  'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 
  'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'
];

@ccheatham
Copy link

THANK YOU!!

@CapSnCrunch
Copy link

thank you so much

@anthonylan
Copy link

Thanks a lot

@aymanmouss
Copy link

Thank you

@evyatar-reif
Copy link

Thank youi :)

@kyj666pao
Copy link

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment