EDITABLE CODE:
LiveDemo:jQuery - map() Method
Note: The $.map() method applies a function to each item in an array.