This pattern is fairly common; I saw this in several places, including jQuery source code:
var arr = "word1 word2 word3".split(" ");
as an alternative to the "normal" array initialization methods:
var arr1 = [ "word1", "word2", "word3" ]; var arr2 = new Array( "word1", "word2", "word3" );
What are the benefits of a line split approach?
source share