Skip to content

Latest commit

 

History

History
122 lines (71 loc) · 2.83 KB

File metadata and controls

122 lines (71 loc) · 2.83 KB

SplitSymbol

Symbol which specifies a method that splits a string at the indices that match a regular expression.

Usage

var SplitSymbol = require( '@stdlib/symbol/split' );

SplitSymbol

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'

Notes

  • The symbol is only supported in environments which support symbols. In non-supporting environments, the value is null.

Examples

var defineProperty = require( '@stdlib/utils/define-property' );
var SplitSymbol = require( '@stdlib/symbol/split' );

var obj = {};

function split( str ) {
    return str.split( '' );
}

defineProperty( obj, SplitSymbol, {
    'configurable': true,
    'value': split
});

console.log( 'hello'.split( obj ) );