A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/lodash-_-lt-method/ below:

Lodash _.lt() Method - GeeksforGeeks

Lodash _.lt() Method

Last Updated : 03 Nov, 2023

Lodash _.lt() method checks if the value is less than the other value.

Syntax:
_.lt(value, other);
Parameters: Return Value:

This method returns true if the value is less than other else false.

Example 1: In this example, it is returning true as 34 is less than 67.

javascript
// Requiring the lodash library 
const _ = require('lodash');

// Original array 
let num = _.lt(34, 67);

// Using the _.lt() method
let less_elem = (num);

// Printing the output 
console.log(less_elem);

Output:

true

Example 2: In this example, it is returning false as 77 is not less than 77.

javascript
// Requiring the lodash library 
const _ = require('lodash');

// Original array 
let num = _.lt(77, 77);

// Using the _.lt() method
let less_elem = (num);

// Printing the output 
console.log(less_elem);

Output:

false

Example 3: In this example, it is returning false as 56 is not less than 36.

javascript
// Requiring the lodash library 
const _ = require('lodash');

// Original array 
let num = _.lt(56, 36);

// Using the _.lt() method
let less_elem = (num);

// Printing the output 
console.log(less_elem);

Output:

false

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