Why is this splitting with a function instead of using an array literal?