Little nit: I think we can use the native JavaScript trim() function here.