Symbol which specifies a method that splits a string at the indices that match a regular expression.
var SplitSymbol = require( '@stdlib/symbol/split' );symbol which specifies a method that splits a string at the indices that match a regular expression.
var s = typeof SplitSymbol;
// e.g., returns 'symbol'var defineProperty = require( '@stdlib/utils/define-property' );
var SplitSymbol = require( '@stdlib/symbol/split' );
function splitter( str ) {
return str.split( '-' );
}
var obj = {};
defineProperty( obj, SplitSymbol, {
'configurable': true,
'value': null
});
var str = 'a-b-c-d-e';
console.log( str.split( obj ) );
defineProperty( obj, SplitSymbol, {
'configurable': true,
'value': splitter
});
console.log( str.split( obj ) );