Realated Questions
Consider the following code snippet
const pi=3.14; var pi=4; console.log(pi);
What will be the output for the above code snippet?
Syntax for creating a RegExp object:
1. var txt=new RegExp(pattern,attributes);
2. var txt=/pattern/attributes;
Which of the above mentioned syntax will correct?Which of the following type of variable is visible only within a function where it is defined?