The endsWith()
function of lodash is used to check if the given string ends with the specified target string.
Here's an example of how to use the endsWith()
function:
index.tsx137 chars7 lines
In the above example, we first imported the lodash library using the require()
function. Then, we defined a string str
and used the endsWith()
function to check if the string ends with ld
. Finally, we logged the output to the console, which is true
since str
ends with ld
.
gistlibby LogSnag