Closest Numeric Match

# Introduction In this lab, we will explore how to find the closest number from an array using JavaScript. We will use the `Array.prototype.reduce()` method and the `Math.abs()` function to compare the distance between each element in the array and a target value, returning the closest match. By the end of this lab, you will have a better understanding of how to implement this useful function in your JavaScript projects.

|60 : 00

Click the virtual machine below to start practicing