Last Updated : 04 Sep, 2024
Lodash _.isString() method is used to find whether the given value is a string object or not. It returns True if the given value is a string. Otherwise, it returns false.
Syntax:_.isString(value);Parameters:
Example 1: In this example, we are checking whether the given value is a string or not, if it is a string then it is giving us true value.
JavaScript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isString() method
console.log(_.isString('GeeksforGeeks'));
console.log(_.isString(true));
Output:
true
false
Example 2: In this example, we are checking whether the given value is a string or not, if it is a string then it is giving us true value.
JavaScript
// Requiring the lodash library
const _ = require("lodash");
// Use of _.isString() method
console.log(_.isString('123'));
console.log(_.isString(123));
console.log(_.isString("0.123"));
Output:
true
false
true
Note: This code will not work in normal JavaScript because it requires the library lodash to be installed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4