14 lines
298 B
JavaScript
14 lines
298 B
JavaScript
String.prototype.sub_String = function()
|
|
{
|
|
var subset = [];
|
|
for (var m = 0; m < this.length; m++)
|
|
{
|
|
for (var n = m+1; n<this.length+1; n++)
|
|
{
|
|
subset.push(this.slice(m,n));
|
|
}
|
|
}
|
|
return subset;
|
|
};
|
|
|
|
console.log("dog".sub_String());
|