KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Please help me to understand why the following code works: var re = RegExp('\\ba\\b') ; console.log(re.test('a')) ; console.log(re.test('ab')) ; In the first line there is no new operator. As far as I know, a contructor in JavaScript is a function that initialize objects created by the operator new and they are not meant to return anything.
Tags (comma-separated)
Save Edits
Cancel