Find first half of string
Return the first half of the given string. The input string's length will always be in even number.
Sample Code:
function firstHalf(str) {
// Enter your logic here...
}
Examples:
Input: '123456'
Output: '123'
Explanation: '123' is the first half of the given string.
Input: 'Python'
Output: 'Pyt'
Explanation: 'Pyt' is the first half of the given string.