mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-06-07 21:16:14 +01:00
Add string convenience method.
This commit is contained in:
@ -17,3 +17,7 @@ String.isNullOrWhitespace = function( input ) {
|
|||||||
String.prototype.endsWith = function(suffix) {
|
String.prototype.endsWith = function(suffix) {
|
||||||
return this.indexOf(suffix, this.length - suffix.length) !== -1;
|
return this.indexOf(suffix, this.length - suffix.length) !== -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
String.is = function( val ) {
|
||||||
|
return typeof val === 'string' || val instanceof String;
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user