Script/Reference/Global_Objects/Object/constructor)
    2. [ ` Object.prototype.__proto__ ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto) Deprecated 
  13. Methods 
    1. [ ` Object.prototype.__defineGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineGetter__) Deprecated 
    2. [ ` Object.prototype.__defineSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__defineSetter__) Deprecated 
    3. [ ` Object.prototype.__lookupGetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupGetter__) Deprecated 
    4. [ ` Object.prototype.__lookupSetter__() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/__lookupSetter__) Deprecated 
    5. [ ` Object.prototype.hasOwnProperty() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty)
    6. [ ` Object.prototype.isPrototypeOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf)
    7. [ ` Object.prototype.propertyIsEnumerable() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/propertyIsEnumerable)
    8. [ ` Object.prototype.toLocaleString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toLocaleString)
    9. [ ` Object.prototype.toString() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString)
    10. [ ` Object.prototype.valueOf() ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf)

##  In this article

  * Try it 
  * Syntax 
  * Description 
  * Examples 
  * Specifications 
  * Browser compatibility 
  * See also 

#  RegExp.prototype[@@split]()

The **` [@@split]() ` ** method of [ ` RegExp ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) instances specifies
how [ ` String.prototype.split ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/String/split) should behave
when the regular expression is passed in as the separator.

##  Try it

##  Syntax

js

    
    
    regexp[Symbol.split](str)
    regexp[Symbol.split](str, limit)
    

###  Parameters

` str `

    

The target of the split operation.

` limit ` Optional

    

Integer specifying a limit on the number of splits to be found. The `
[@@split]() ` method still splits on every match of ` this ` RegExp pattern
(or, in the Syntax above, ` regexp ` ), until the number of split items match
the ` limit ` or the string falls short of ` this ` pattern.

###  Return value

An [ ` Array ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)
containing substrings as its elements. Capturing groups are included.

##  Description

This method is called internally in [ ` String.prototype.split() ` ](/en-
US/docs/Web/JavaScript/Reference/Global_Objects/String/split) when a ` RegExp
` is passed as the separator. For example, the following two examples return
the same result.

js

    
    
    "a-b-c".split(/-/);
    
    /-/[Symbol.split]("a-b-c");
    

This method exists for customizing the behavior of ` split() ` in ` RegExp `
subclasses.

The ` RegExp.prototype[@@split]() ` base method exhibits the following
behaviors:

  * It starts by using [ ` @@species ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/@@species) to construct a new regexp, thus avoiding mutating the original regexp in any way. 
  * The regexp's ` g ` ("global") flag is ignored, and the ` y ` ("sticky") flag is always applied even when it was not originally present. 
  * If the target string is empty, and the regexp can match empty strings (for example, ` /a?/ ` ), an empty array is returned. Otherwise, if the regexp can't match an empty string, ` [""] ` is returned. 
  * The matching proceeds by continuously calling ` this.exec() ` . Since the regexp is always sticky, this will move along the string, each time yielding a matching string, index, and any capturing groups. 
  * For each match, the substring between the last matched string's end and the current matched string's beginning is first