When an array contains primitive values, you can use the Array.includes() method to test if a value exists within that array.
- Download or fork/clone this Gist into your workspace.
- Using conditional statements and the
Array.includes()method, test if the entered command line value exists in thecharacterClassesarray:-
If
truelog the following to the console:"[inputted value]" is a valid Character Class!` -
If
falselog the following to the console:"[inputted value]" is NOT a valid Character Class! Please try again.`
-
A potential answer to this activity.