Write a function that takes in a list of names and has an optional proc, which can be invoked to format the names in a specific manner. If no proc is given, return the original list.
attendance_list(["Sarah Smith", "John Jones", "Mickey Mouse"])
➞ ["Sarah Smith", "John Jones", "Mickey Mouse"]
attendance_list(["Sarah Smith", "John Jones", "Mickey Mouse"]){|x| x.split[0]}
➞ ["Sarah", "John", "Mickey"]
attendance_list(["Sarah Smith", "John Jones", "Mickey Mouse"]){|x| "#{x.split[0][0]}. #{x.split[1][0]}."}
➞ ["S. S.", "J. J.", "M. M."]
attendance_list(["Sarah Smith", "John Jones", "Mickey Mouse"]){|x| "#{x.split[1]}, #{x.split[0]}."}
➞ ["Smith, Sarah", "Jones, John", "Mouse, Mickey"]N/A