var arr = [\'a\', \'b\', \'c\', \'d\', \'e\', \'f\']; var point = \'c\';
How can I split the \"arr\" into two arrays based on the \"point\" variabl
Try this one:
var arr = ['a', 'b', 'c', 'd', 'e', 'f']; var point = 'c'; var idx = arr.indexOf(point); arr.slice(0, idx) // ["a", "b"] arr.slice(idx + 1) // ["d", "e", "f"]