Given a word, write a function that returns the first index and the last index of a character.
char_index("hello", "l") ➞ [2, 3]
# The first "l" has index 2, the last "l" has index 3.
char_index("circumlocution", "c") ➞ [0, 8]
# The first "c" has index 0, the last "c" has index 8.
char_index("happy", "h") ➞ [0, 0]
# Only one "h" exists, so the first and last index is 0.
char_index("happy", "e") ➞ None
# "e" does not exist in "happy", so we return undefined.
None.