N Min Elements

# Introduction In this lab, we will explore the `minN()` function in JavaScript, which returns the `n` minimum elements from an array. We will learn how to use `Array.prototype.sort()` and `Array.prototype.slice()` methods to create a shallow clone of the array, sort it in ascending order, and get the specified number of elements. By the end of this lab, you will have a better understanding of how to manipulate arrays in JavaScript using these methods.

|60 : 00

Click the virtual machine below to start practicing