How to split string in ES6. I would suggest the method of using split function from lodash. In modern JavaScript frontend you use a lot of dependencies and lodash is used in almost every project. Leave function maintenance to the communities keen eye and use lodash.
Source code viewer
import _split from 'lodash/split'; _split([string=''], separator, [limit]);Programming Language: ECMAScript