InterviewSolution
Saved Bookmarks
| 1. |
Are there constants in JavaScript? |
|
Answer» Let’s say the FOLLOWING is our string with numbers: VAR strNum = "only123!";To fetch the digits from the above string, the following REGEXP is used: /\d/GAbove we have set the g flag to perform global match. The output: String with numbers: only123! Getting Digits = 1,2,3 |
|