Underscore.js _.isString() Function (original) (raw)
Last Updated : 01 Aug, 2023
The _.isString() function is used to check whether the given object element is string or not.
Syntax:
_.isString( object )
Parameters: This function accepts single parameter as mentioned above and described below:
- object: It contains the value of object that need to be check whether it is an string or not.
Return Value: It returns a Boolean value True if given object element is string, False otherwise.
Example 1:
<!DOCTYPE html>
<
html
>
<
head
>
`` <
script
type
=
"text/javascript"
`` src
=
`` </
script
>
</
head
>
<
body
>
`` <
script
type
=
"text/javascript"
>
`` var info = {
`` Company: 'GeeksforGeeks',
`` Address: 'Noida',
`` Contact: '+91 9876543210'
`` };
`` console.log(_.isString(info));
`` var str = 'GeeksforGeeks';
`` console.log(_.isString(str));
`` </
script
>
</
body
>
</
html
>
Output:
Example 2:
Output:
Similar Reads
- Underscore.js _.isSet() Function Underscore.js is a library in javascript that makes operations on arrays, string, objects much easier and handy. _.isSet() function is used to check whether the given object is javascript set or not. When linking the underscore.js CDN The "_" is attached to the browser as global variable. Syntax: _. 2 min read
- Underscore.js _.isNaN() Function _.isNaN() function: It is used to find whether the value of the object passed is NaN or not.If the object's value is NaN then the output will be true otherwise, it will be false.We can even perform addition, subtraction etc operations in this function. Syntax: _.isNaN(object) Parameters:It takes onl 3 min read
- Underscore.js _.isFunction() Function The _.isFunction() function is used to check whether the given object is function or not. It returns a Boolean value True if the given object is a function and returns False otherwise. Syntax: _.isFunction( object ) Parameters: This function accepts single parameter as mentioned above and described 1 min read
- Underscore.js _.isNull() Function Underscore.js _.isNull() function It is used to find whether the value of the object is null. If an object has a null value then the output will be true otherwise false. We can even perform addition, subtraction, etc operations in this function. Syntax:Â _.isNull(object);Parameters:It takes only one 3 min read
- Underscore.js _.isRegExp() Function _.isRegExp() function: It finds whether the object passed is a regular expression or not. If the object is a regular expression then it returns true otherwise false. We can even apply operations like addition etc on the variables in which the result of _.isRegExp() is stored. Syntax: _.isRegExp(obje 3 min read
- Underscore.js _.isFinite() Function The _.isFinite() function is used to check whether the value of the parameter passed is finite or not. If the parameter has an infinite value the output is false otherwise, true. We can even perform any operation like addition, subtraction in this function. Syntax:_.isFinite(object) Parameters:It ta 3 min read
- Underscore.js _.isWeakSet() Function Underscore.js is a JavaScript library that makes operations on arrays, string, objects much easier and handy. he _.isWeakSet() function is used to check whether the given object is JavaScript weakset or not. When linking the underscore.js CDN, the "_" is attached to the browser as global variable. S 2 min read
- Underscore.js _.isError() Function Underscore.js is a library in javascript that makes operations on arrays, string, objects much easier and handy. _.isError() function is used to check whether the given object is javascript Error Object or not. Note: It is very necessary to link the underscore CDN before going and using underscore f 2 min read
- Underscore.js _.isMatch() Function It _.isMatch() function: is used to find out if the property given in argument is present in the passed array or not. Also, the property's value should be the same in order to match. It is used in cases where we want to find whether the array satisfies a specific condition or not. Syntax:_.isMatch(o 3 min read
- Underscore.js _.isArray() Function The Underscore.js is a JavaScript library that provides a lot of useful functions like the map, filter, invoke, etc even without using any built-in objects. The _.isArray() function is used to find whether the passed argument is an array or not. An array is a set of variables, constants, and special 3 min read