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
Use indexOf and slice
var arr = ['a', 'b', 'c', 'd', 'e', 'f']; var indexToSplit = arr.indexOf('c'); var first = arr.slice(0, indexToSplit); var second = arr.slice(indexToSplit + 1); console.log({first, second});