1.0.1 • Published 8 years ago
hasWord v1.0.1
hasWord()
A string method to check to see if a string contains a word.
'this is a test string'.hasWord('test'); returns true
'this is a test string'.hasWord('node'); returns false
Of course this works with variables as well:
let string = 'this is a test';
string.hasWord('test'); returns true
string.hasWord('node'); returns false