To use the _.lowerCase()
function from Lodash in JavaScript, you need to first install Lodash by running npm install lodash
in your terminal. Once you have Lodash installed, you can use the _.lowerCase()
function as follows:
160 chars7 lines
In the above code, we first import the lodash
library using the import _ from "lodash";
statement. Then, we declare a string myString
and assign it the value "HELLO WORLD". We then use the _.lowerCase(myString)
function to convert the string to lowercase and assign the result to lowerCaseString
. Finally, we log the value of lowerCaseString
to the console, which will output "hello world".
gistlibby LogSnag