Extract first half of string

Write a function that takes a string (a) as argument. Extract the first half of a. Return the result
JavaScript
Console