javascript 5cw

Solutions on MaxInterview for javascript 5cw by the best coders in the world

showing results for - "javascript 5cw"
Mira
24 Jan 2017
1\w
2//This shortcut is equal to [A-Za-z0-9_].
3//This character class matches upper and lowercase letters plus numbers.
4//Note, this character class also includes the underscore character (_).
5
6let longHand = /[A-Za-z0-9_]+/;
7let shortHand = /\w+/;
8let numbers = "42";
9let varNames = "important_var";
10longHand.test(numbers); // Returns true
11shortHand.test(numbers); // Returns true
12longHand.test(varNames); // Returns true
13shortHand.test(varNames); // Returns true
14