Uppercase and Lowercase Mixed

Write code to transform the string str so that its first and last letters are uppercase, and the middle letter is lowercase.
Use string indexing (e.g., str[0]), toUpperCase(), and toLowerCase() in your solution.
JavaScript
Console