0
How do I get the output of // sololearn, from the following code? Because when I study, regexp test () only produces boolean!
3 odpowiedzi
0
Must with function test(),
0
RegExp.test method can only return a boolean
to get more information use RegExp.exec method instead:
function regex(value){
console.log(/sololearn/.exec(value));
}
regex ('sololearn')
- 1
function regex(value){
console.log (value);
}
regex ('sololearn')