Working with lodash _.dropRight

Medium
8.3% Acceptance

In this lab, you'll learn about the _.dropRight function provided by the lodash library. The _.dropRight function creates a slice of an array with n elements removed from the end. The syntax for _.dropRight function is _.dropRight(array, [n=1]), where array is the input array on which you want to perform the operation, and n is an optional parameter representing the number of elements to remove. If not provided, it defaults to 1. Note: This function does not modify the original array; it returns a new array with the changes.

For this lab, you'll create several functions to perform various tasks using the lodash _.dropRight function. We will be using ESM imports for this lab. This is how you can import the lodash dropRight function in your project:

import dropRight from 'lodash/dropRight.js';

Then you can use the dropRight function in your code.